Skip to content

Commit

Permalink
Fix offset for nulls
Browse files Browse the repository at this point in the history
Signed-off-by: Nghia Truong <[email protected]>
  • Loading branch information
ttnghia committed Mar 1, 2024
1 parent e96ff74 commit c374df1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cpp/tests/io/parquet_chunked_reader_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ auto write_file(std::vector<std::unique_ptr<cudf::column>>& 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(
Expand All @@ -82,6 +80,10 @@ auto write_file(std::vector<std::unique_ptr<cudf::column>>& 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;
}
}

Expand Down Expand Up @@ -905,7 +907,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);
}

Expand Down

0 comments on commit c374df1

Please sign in to comment.