Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward-merge branch-23.08 to branch-23.10 #13759

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cpp/src/io/orc/dict_enc.cu
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ __global__ void rowgroup_char_counts_kernel(device_2dspan<size_type> char_counts

auto const& offsets = str_col.child(strings_column_view::offsets_column_index);
char_counts[str_col_idx][row_group_idx] =
offsets.element<size_type>(start_row + num_rows) - offsets.element<size_type>(start_row);
(num_rows == 0)
? 0
: offsets.element<size_type>(start_row + num_rows) - offsets.element<size_type>(start_row);
}

void rowgroup_char_counts(device_2dspan<size_type> counts,
Expand Down
17 changes: 17 additions & 0 deletions cpp/tests/io/orc_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1844,4 +1844,21 @@ TEST_F(OrcWriterTest, SlicedStringColumn)
CUDF_TEST_EXPECT_TABLES_EQUAL(expected_slice, result.tbl->view());
}

TEST_F(OrcWriterTest, EmptyChildStringColumn)
{
list_col<cudf::string_view> col{{}, {}};
table_view expected({col});

auto filepath = temp_env->get_temp_filepath("OrcEmptyChildStringColumn.orc");
cudf::io::orc_writer_options out_opts =
cudf::io::orc_writer_options::builder(cudf::io::sink_info{filepath}, expected);
cudf::io::write_orc(out_opts);

cudf::io::orc_reader_options in_opts =
cudf::io::orc_reader_options::builder(cudf::io::source_info{filepath}).use_index(false);
auto result = cudf::io::read_orc(in_opts);

CUDF_TEST_EXPECT_TABLES_EQUAL(expected, result.tbl->view());
}

CUDF_TEST_PROGRAM_MAIN()