From ea405968a2986fb4e71fbc30e7f9370e48f6344b Mon Sep 17 00:00:00 2001 From: Nghia Truong <7416935+ttnghia@users.noreply.github.com> Date: Tue, 19 Mar 2024 01:14:14 -0600 Subject: [PATCH] Fix `offset` value for generating test data in `parquet_chunked_reader_test.cu` (#15200) In `parquet_chunked_reader_test.cu`, when generating test data, there is an `offset` value that should increase at every iteration. It is for shifting the null positions of each column such that the generating table will not have all nulls in the same rows. Somehow, it was left unchanged across all iterations, thus we need to fix that. Authors: - Nghia Truong (https://github.com/ttnghia) - Karthikeyan (https://github.com/karthikeyann) Approvers: - https://github.com/nvdbaranec - Bradley Dice (https://github.com/bdice) - Karthikeyan (https://github.com/karthikeyann) URL: https://github.com/rapidsai/cudf/pull/15200 --- cpp/tests/io/parquet_chunked_reader_test.cu | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cpp/tests/io/parquet_chunked_reader_test.cu b/cpp/tests/io/parquet_chunked_reader_test.cu index 2c992677a65..b1c0ff9b5a8 100644 --- a/cpp/tests/io/parquet_chunked_reader_test.cu +++ b/cpp/tests/io/parquet_chunked_reader_test.cu @@ -66,8 +66,6 @@ auto write_file(std::vector>& input_columns, std::size_t max_page_size_bytes = cudf::io::default_max_page_size_bytes, std::size_t max_page_size_rows = cudf::io::default_max_page_size_rows) { - // Just shift nulls of the next column by one position to avoid having all nulls in the same - // table rows. if (nullable) { // Generate deterministic bitmask instead of random bitmask for easy computation of data size. auto const valid_iter = cudf::detail::make_counting_transform_iterator( @@ -83,6 +81,10 @@ auto write_file(std::vector>& input_columns, std::move(col), cudf::get_default_stream(), rmm::mr::get_current_device_resource()); + + // Shift nulls of the next column by one position, to avoid having all nulls + // in the same table rows. + ++offset; } } @@ -988,7 +990,7 @@ TEST_F(ParquetChunkedReaderTest, TestChunkedReadWithListsOfStructs) { auto const [result, num_chunks] = chunked_read(filepath_with_nulls, 1'500'000); - EXPECT_EQ(num_chunks, 4); + EXPECT_EQ(num_chunks, 5); CUDF_TEST_EXPECT_TABLES_EQUAL(*expected_with_nulls, *result); }