Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1cb92fc
Refactor hybrid scan multifile API to enhance bloom filter functionality
qbacpey Jun 11, 2026
815ca02
Enhance hybrid scan multifile API with improved bloom filter handling
qbacpey Jun 14, 2026
51e4c0e
Update comments in hybrid scan multifile filters test for clarity
qbacpey Jun 14, 2026
18e492d
Merge branch 'main' into hybrid/api-split-t1
mhaseeb123 Jun 15, 2026
dbb6284
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey Jun 15, 2026
b8baad7
Refactor bloom filter functions in hybrid scan implementation
qbacpey Jun 15, 2026
a750d47
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey Jun 22, 2026
2077626
Merge branch 'main' into hybrid/api-split-t1
qbacpey Jun 24, 2026
28177c9
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey Jun 25, 2026
aff5c7f
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey Jul 24, 2026
25c6be0
Format
qbacpey Jul 24, 2026
3dcdeb5
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey Jul 27, 2026
2484b20
Enhance bloom filter validation in hybrid scan implementation
qbacpey Jul 27, 2026
4d4bbc9
Refactor bloom filter parameter types to use std::span
qbacpey Jul 27, 2026
df86dc8
Add tests for parquet bloom filter behavior with absent and mixed pre…
qbacpey Jul 28, 2026
d9c3bed
Style
qbacpey Jul 28, 2026
9f497b9
Merge branch 'main' into hybrid/api-split-t1
qbacpey Jul 28, 2026
99eebce
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey Aug 3, 2026
03c9df3
Update bloom filter parameter description and fix comment in hybrid s…
qbacpey Aug 3, 2026
a2ff9e3
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey Aug 4, 2026
95388b0
Add dictionary page filtering and update bloom filter documentation
qbacpey Aug 5, 2026
b0567a4
Merge branch 'main' into hybrid/api-split-t1
qbacpey Aug 5, 2026
969cbac
Enhance Parquet testing with bloom filter alignment and pruning
qbacpey Aug 6, 2026
59219e1
Merge branch 'main' into hybrid/api-split-t1
qbacpey Aug 6, 2026
c31aa10
Merge branch 'main' into hybrid/api-split-t1
qbacpey Aug 7, 2026
eae0894
Let `test_parquet` use `read_parquet` only
qbacpey Aug 11, 2026
3ea856c
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey Aug 11, 2026
12bd65b
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey Aug 17, 2026
cf1fe4e
Merge branch 'main' into hybrid/api-split-t1
qbacpey Aug 18, 2026
e8ecae7
Merge branch 'main' into hybrid/api-split-t1
qbacpey Aug 18, 2026
6dc0260
Merge branch 'main' into hybrid/api-split-t1
qbacpey Aug 18, 2026
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
29 changes: 22 additions & 7 deletions cpp/include/cudf/io/experimental/hybrid_scan_multifile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,35 @@ class hybrid_scan_multifile {
rmm::cuda_stream_view stream) const;

/**
* @brief Get byte ranges of bloom filters and dictionary pages (secondary filters) for row group
* pruning
* @brief Get byte ranges of bloom filters for row group pruning
*
Comment thread
qbacpey marked this conversation as resolved.
Resolved
* @note Device buffers for bloom filter byte ranges must be allocated using a 32 byte
* aligned memory resource
*
* @param row_group_indices Input row group indices, one per source
* @param options Parquet reader options
* @return Pair of vectors of byte ranges of column chunk with bloom filters and dictionary
* pages subject to filter predicate
* @return Vector of byte ranges of column chunk bloom filters subject to filter predicate
*/
[[nodiscard]] std::pair<std::vector<byte_range_info>, std::vector<byte_range_info>>
secondary_filters_byte_ranges(cudf::host_span<std::vector<size_type> const> row_group_indices,
parquet_reader_options const& options) const;
[[nodiscard]] std::vector<byte_range_info> bloom_filters_byte_ranges(
cudf::host_span<std::vector<size_type> const> row_group_indices,
parquet_reader_options const& options) const;

/**
* @brief Filter the row groups using column chunk bloom filters
*
* @note The `bloom_filter_data` device spans must point to 32-byte aligned addresses
*
* @param bloom_filter_data Device spans of bloom filters, one per input column chunk
* @param row_group_indices Input row group indices
* @param options Parquet reader options
* @param stream CUDA stream used for device memory operations and kernel launches
* @return Filtered per-source row group indices (one inner vector per source)
Comment thread
qbacpey marked this conversation as resolved.
Resolved
*/
[[nodiscard]] std::vector<std::vector<size_type>> filter_row_groups_with_bloom_filters(
cudf::host_span<cudf::device_span<uint8_t const> const> bloom_filter_data,
cudf::host_span<std::vector<size_type> const> row_group_indices,
parquet_reader_options const& options,
rmm::cuda_stream_view stream) const;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
Comment thread
qbacpey marked this conversation as resolved.
Resolved

private:
std::unique_ptr<detail::hybrid_scan_reader_impl> _impl;
Expand Down
16 changes: 16 additions & 0 deletions cpp/src/io/parquet/experimental/hybrid_scan_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,22 @@ hybrid_scan_reader_impl::secondary_filters_byte_ranges(
return {bloom_filter_bytes, dictionary_page_bytes};
}

std::vector<byte_range_info> hybrid_scan_reader_impl::bloom_filters_byte_ranges(
cudf::host_span<std::vector<size_type> const> row_group_indices,
parquet_reader_options const& options)
{
CUDF_EXPECTS(not row_group_indices.empty(), "Empty input row group indices encountered");
auto [expr_conv, output_dtypes] = prepare_filter_and_output_types(options);

auto const bloom_filter_bytes =
_extended_metadata->get_bloom_filter_bytes(row_group_indices,
output_dtypes,
_output_column_schemas,
expr_conv.get_converted_expr().value());

return bloom_filter_bytes;
}

Comment thread
qbacpey marked this conversation as resolved.
Resolved
std::vector<std::vector<size_type>>
hybrid_scan_reader_impl::filter_row_groups_with_dictionary_pages(
cudf::host_span<cudf::device_span<uint8_t const> const> dictionary_page_data,
Expand Down
7 changes: 7 additions & 0 deletions cpp/src/io/parquet/experimental/hybrid_scan_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ class hybrid_scan_reader_impl : public parquet::detail::reader_impl {
secondary_filters_byte_ranges(cudf::host_span<std::vector<size_type> const> row_group_indices,
parquet_reader_options const& options);

/**
* @copydoc cudf::io::experimental::hybrid_scan_multifile::bloom_filters_byte_ranges
*/
[[nodiscard]] std::vector<byte_range_info> bloom_filters_byte_ranges(
cudf::host_span<std::vector<size_type> const> row_group_indices,
parquet_reader_options const& options);

/**
* @copydoc cudf::io::experimental::hybrid_scan::filter_row_groups_with_dictionary_pages
*/
Expand Down
16 changes: 13 additions & 3 deletions cpp/src/io/parquet/experimental/hybrid_scan_multifile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,23 @@ std::vector<std::vector<size_type>> hybrid_scan_multifile::filter_row_groups_wit
return _impl->filter_row_groups_with_stats(row_group_indices, options, stream);
}

std::pair<std::vector<text::byte_range_info>, std::vector<text::byte_range_info>>
hybrid_scan_multifile::secondary_filters_byte_ranges(
std::vector<text::byte_range_info> hybrid_scan_multifile::bloom_filters_byte_ranges(
cudf::host_span<std::vector<size_type> const> row_group_indices,
parquet_reader_options const& options) const
{
CUDF_FUNC_RANGE();
return _impl->secondary_filters_byte_ranges(row_group_indices, options);
return _impl->bloom_filters_byte_ranges(row_group_indices, options);
}

std::vector<std::vector<size_type>> hybrid_scan_multifile::filter_row_groups_with_bloom_filters(
cudf::host_span<cudf::device_span<uint8_t const> const> bloom_filter_data,
cudf::host_span<std::vector<size_type> const> row_group_indices,
parquet_reader_options const& options,
rmm::cuda_stream_view stream) const
{
CUDF_FUNC_RANGE();
return _impl->filter_row_groups_with_bloom_filters(
bloom_filter_data, row_group_indices, options, stream);
}

} // namespace cudf::io::parquet::experimental
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,61 @@ TEST_F(HybridScanMultifileFiltersTest, FilterRowGroupsWithStats)
EXPECT_TRUE(stats_filtered.front().empty());
EXPECT_TRUE(stats_filtered.back().empty());
}

TEST_F(HybridScanMultifileFiltersTest, FilterRowGroupsWithBloomFilters)
{
using T = uint32_t;
auto constexpr num_sources = 2;
auto const stream = cudf::get_default_stream();

// Two sources, each with 4 row groups
std::vector<std::vector<char>> file_buffers;
file_buffers.reserve(num_sources);
srand(0xb100);
file_buffers.emplace_back(std::get<1>(create_parquet_with_stats<T, 1>()));
srand(0x600d);
file_buffers.emplace_back(std::get<1>(create_parquet_with_stats<T, 1>()));

auto inputs = build_multifile_inputs(file_buffers);
Comment thread
qbacpey marked this conversation as resolved.
Resolved

// An equality predicate makes col0 eligible for bloom filtering. cuDF's Parquet writer does not
// emit bloom filters, so the per-source bloom byte ranges come back empty (same as single-file).
{
auto literal_value = cudf::numeric_scalar<T>(T{42}, true, stream);
auto literal = cudf::ast::literal(literal_value);
auto col_ref = cudf::ast::column_name_reference("col0");
auto filter = cudf::ast::operation(cudf::ast::ast_operator::EQUAL, col_ref, literal);

auto options = cudf::io::parquet_reader_options::builder().filter(filter).build();
auto const reader = std::make_unique<cudf::io::parquet::experimental::hybrid_scan_multifile>(
inputs.footer_byte_spans, options);

auto const input_row_group_indices = reader->all_row_groups(options);
ASSERT_EQ(input_row_group_indices.size(), num_sources);

auto const bloom_byte_ranges =
reader->bloom_filters_byte_ranges(input_row_group_indices, options);
EXPECT_TRUE(bloom_byte_ranges.empty());
}
Comment thread
qbacpey marked this conversation as resolved.
Resolved

// Without any bloom-eligible (equality) predicate, bloom filtering is a no-op: the reader returns
// the input row groups unchanged, one inner vector per source. Validates the multifile bloom
// filter API delegation and per-source output shape.
{
auto literal_value = cudf::numeric_scalar<T>(T{50}, true, stream);
auto literal = cudf::ast::literal(literal_value);
auto col_ref = cudf::ast::column_name_reference("col0");
auto filter = cudf::ast::operation(cudf::ast::ast_operator::LESS, col_ref, literal);

auto options = cudf::io::parquet_reader_options::builder().filter(filter).build();
auto const reader = std::make_unique<cudf::io::parquet::experimental::hybrid_scan_multifile>(
inputs.footer_byte_spans, options);

auto const input_row_group_indices = reader->all_row_groups(options);
ASSERT_EQ(input_row_group_indices.size(), num_sources);

auto const bloom_filtered =
reader->filter_row_groups_with_bloom_filters({}, input_row_group_indices, options, stream);
EXPECT_EQ(bloom_filtered, input_row_group_indices);
}
}
Comment thread
qbacpey marked this conversation as resolved.
Resolved
Loading