From 20ad6e707a5736aee34c23ab4ac2df6df1a08f87 Mon Sep 17 00:00:00 2001 From: vuule Date: Fri, 26 May 2023 15:59:36 -0700 Subject: [PATCH 1/2] update data_ptr for empty rowgroups --- cpp/src/io/orc/stripe_enc.cu | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpp/src/io/orc/stripe_enc.cu b/cpp/src/io/orc/stripe_enc.cu index 0e76dc13471..27a51a0f591 100644 --- a/cpp/src/io/orc/stripe_enc.cu +++ b/cpp/src/io/orc/stripe_enc.cu @@ -1108,11 +1108,10 @@ __global__ void __launch_bounds__(compact_streams_block_size) for (uint32_t i = t; i < len; i += blockDim.x) { dst_ptr[i] = src_ptr[i]; } - __syncthreads(); - if (t == 0) { streams[ss.column_id][group].data_ptrs[cid] = dst_ptr; } - dst_ptr += len; } + if (t == 0) { streams[ss.column_id][group].data_ptrs[cid] = dst_ptr; } + dst_ptr += len; } } From 9be927ab8b4cd62bb07a8cea60e424b3a6ab40e0 Mon Sep 17 00:00:00 2001 From: vuule Date: Fri, 26 May 2023 16:17:17 -0700 Subject: [PATCH 2/2] test --- cpp/tests/io/orc_test.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cpp/tests/io/orc_test.cpp b/cpp/tests/io/orc_test.cpp index 60b3dad5568..a2222e8ae9d 100644 --- a/cpp/tests/io/orc_test.cpp +++ b/cpp/tests/io/orc_test.cpp @@ -1788,4 +1788,22 @@ TEST_F(OrcChunkedWriterTest, CompStatsEmptyTable) expect_compression_stats_empty(stats); } +TEST_F(OrcWriterTest, EmptyRowGroup) +{ + std::vector ints(10000 + 5, -1); + auto mask = cudf::detail::make_counting_transform_iterator(0, [](auto i) { return i >= 10000; }); + int32_col col{ints.begin(), ints.end(), mask}; + table_view expected({col}); + + auto filepath = temp_env->get_temp_filepath("OrcEmptyRowGroup.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}); + auto result = cudf::io::read_orc(in_opts); + CUDF_TEST_EXPECT_TABLES_EQUAL(expected, result.tbl->view()); +} + CUDF_TEST_PROGRAM_MAIN()