-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove multi-file secondary-filter API and add bloom-filter pruning to hybrid scan #22861
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
Merged
Merged
Changes from all commits
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 815ca02
Enhance hybrid scan multifile API with improved bloom filter handling
qbacpey 51e4c0e
Update comments in hybrid scan multifile filters test for clarity
qbacpey 18e492d
Merge branch 'main' into hybrid/api-split-t1
mhaseeb123 dbb6284
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey b8baad7
Refactor bloom filter functions in hybrid scan implementation
qbacpey a750d47
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey 2077626
Merge branch 'main' into hybrid/api-split-t1
qbacpey 28177c9
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey aff5c7f
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey 25c6be0
Format
qbacpey 3dcdeb5
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey 2484b20
Enhance bloom filter validation in hybrid scan implementation
qbacpey 4d4bbc9
Refactor bloom filter parameter types to use std::span
qbacpey df86dc8
Add tests for parquet bloom filter behavior with absent and mixed pre…
qbacpey d9c3bed
Style
qbacpey 9f497b9
Merge branch 'main' into hybrid/api-split-t1
qbacpey 99eebce
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey 03c9df3
Update bloom filter parameter description and fix comment in hybrid s…
qbacpey a2ff9e3
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey 95388b0
Add dictionary page filtering and update bloom filter documentation
qbacpey b0567a4
Merge branch 'main' into hybrid/api-split-t1
qbacpey 969cbac
Enhance Parquet testing with bloom filter alignment and pruning
qbacpey 59219e1
Merge branch 'main' into hybrid/api-split-t1
qbacpey c31aa10
Merge branch 'main' into hybrid/api-split-t1
qbacpey eae0894
Let `test_parquet` use `read_parquet` only
qbacpey 3ea856c
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey 12bd65b
Merge remote-tracking branch 'upstream/main' into hybrid/api-split-t1
qbacpey cf1fe4e
Merge branch 'main' into hybrid/api-split-t1
qbacpey e8ecae7
Merge branch 'main' into hybrid/api-split-t1
qbacpey 6dc0260
Merge branch 'main' into hybrid/api-split-t1
qbacpey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -439,7 +439,8 @@ std::vector<std::vector<cudf::size_type>> aggregate_reader_metadata::filter_row_ | |
| return stats_filtered_row_group_indices.value_or(all_row_group_indices(row_group_indices)); | ||
| } | ||
|
|
||
| std::vector<byte_range_info> aggregate_reader_metadata::get_bloom_filter_bytes( | ||
| std::pair<std::vector<byte_range_info>, std::vector<cudf::size_type>> | ||
| aggregate_reader_metadata::bloom_filters_byte_ranges( | ||
| std::span<std::vector<cudf::size_type> const> row_group_indices, | ||
| std::span<data_type const> output_dtypes, | ||
| std::span<cudf::size_type const> output_column_schemas, | ||
|
|
@@ -463,7 +464,7 @@ std::vector<byte_range_info> aggregate_reader_metadata::get_bloom_filter_bytes( | |
| std::back_inserter(bloom_filter_col_schemas), | ||
| [](auto& bloom_filter_literals) { return not bloom_filter_literals.empty(); }); | ||
|
|
||
| // No equality literals found, return empty vector | ||
| // No equality literals found, return empty pair | ||
| if (bloom_filter_col_schemas.empty()) { return {}; } | ||
|
|
||
| // Compute total number of input row groups | ||
|
|
@@ -476,36 +477,42 @@ std::vector<byte_range_info> aggregate_reader_metadata::get_bloom_filter_bytes( | |
| std::vector<byte_range_info> bloom_filter_bytes; | ||
| bloom_filter_bytes.reserve(num_chunks); | ||
|
|
||
| // Parallel map identifying the source each emitted byte range must be fetched from | ||
| std::vector<cudf::size_type> bloom_filter_source_map; | ||
| bloom_filter_source_map.reserve(num_chunks); | ||
|
|
||
| // Flag to check if we have at least one valid bloom filter offset | ||
| auto have_bloom_filters = false; | ||
|
|
||
| // For all sources | ||
| std::for_each(cuda::counting_iterator<std::size_t>{0}, | ||
| cuda::counting_iterator{row_group_indices.size()}, | ||
| [&](auto const src_index) { | ||
| // Get all row group indices in the data source | ||
| auto const& rg_indices = row_group_indices[src_index]; | ||
| // For all row groups | ||
| std::for_each(rg_indices.cbegin(), rg_indices.cend(), [&](auto const rg_index) { | ||
| // For all column chunks | ||
| std::for_each( | ||
| bloom_filter_col_schemas.begin(), | ||
| bloom_filter_col_schemas.end(), | ||
| [&](auto const schema_idx) { | ||
| auto& col_meta = get_column_metadata(rg_index, src_index, schema_idx); | ||
| // Get bloom filter offsets and sizes | ||
| bloom_filter_bytes.emplace_back(col_meta.bloom_filter_offset.value_or(0), | ||
| col_meta.bloom_filter_length.value_or(0)); | ||
|
|
||
| // Set `have_bloom_filters` if `bloom_filter_offset` is valid | ||
| if (col_meta.bloom_filter_offset.has_value()) { have_bloom_filters = true; } | ||
| }); | ||
| }); | ||
| }); | ||
| std::for_each( | ||
| cuda::counting_iterator<std::size_t>{0}, | ||
| cuda::counting_iterator{row_group_indices.size()}, | ||
| [&](auto const src_index) { | ||
| // Get all row group indices in the data source | ||
| auto const& rg_indices = row_group_indices[src_index]; | ||
| // For all row groups | ||
| std::for_each(rg_indices.cbegin(), rg_indices.cend(), [&](auto const rg_index) { | ||
| // For all column chunks | ||
| std::for_each( | ||
| bloom_filter_col_schemas.begin(), | ||
| bloom_filter_col_schemas.end(), | ||
| [&](auto const schema_idx) { | ||
| auto& col_meta = get_column_metadata(rg_index, src_index, schema_idx); | ||
| // Get bloom filter offsets and sizes | ||
| bloom_filter_bytes.emplace_back(col_meta.bloom_filter_offset.value_or(0), | ||
| col_meta.bloom_filter_length.value_or(0)); | ||
| bloom_filter_source_map.emplace_back(static_cast<cudf::size_type>(src_index)); | ||
|
|
||
| // Set `have_bloom_filters` if `bloom_filter_offset` is valid | ||
| if (col_meta.bloom_filter_offset.has_value()) { have_bloom_filters = true; } | ||
| }); | ||
| }); | ||
| }); | ||
|
|
||
| if (not have_bloom_filters) { return {}; } | ||
|
|
||
| return bloom_filter_bytes; | ||
| return {std::move(bloom_filter_bytes), std::move(bloom_filter_source_map)}; | ||
| } | ||
|
|
||
| std::pair<std::vector<byte_range_info>, std::vector<cudf::size_type>> | ||
|
|
@@ -699,6 +706,13 @@ aggregate_reader_metadata::filter_row_groups_with_bloom_filters( | |
| // Compute total number of input row groups | ||
| auto const total_row_groups = compute_total_row_groups(row_group_indices); | ||
|
|
||
| // Ensure there is one bloom filter data span per eligible column in each row group | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| CUDF_EXPECTS(bloom_filter_data.size() == | ||
| static_cast<std::size_t>(total_row_groups) * bloom_filter_col_schemas.size(), | ||
| "Bloom filter data size must match the number of row groups times the number of " | ||
| "columns with bloom filters and an equality predicate", | ||
| std::invalid_argument); | ||
|
|
||
| // Transform bloom filter data to cuda::std::byte type for apply_bloom_filters | ||
| std::vector<cudf::device_span<cuda::std::byte const>> transformed_bloom_filter_data; | ||
| transformed_bloom_filter_data.reserve(bloom_filter_data.size()); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.