Skip loading Parquet page index when row-group statistics already prove it cannot prune#22857
Open
RatulDawar wants to merge 4 commits into
Open
Skip loading Parquet page index when row-group statistics already prove it cannot prune#22857RatulDawar wants to merge 4 commits into
RatulDawar wants to merge 4 commits into
Conversation
…prune. Reorder the opener so row-group statistics pruning runs before the page index load, and skip that I/O when every surviving row group is fully matched. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve opener test conflicts after upstream moved opener.rs to opener/mod.rs. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
A related question came up while implementing this, can we skip page index I/O per row group (e.g. load index only for RGs that aren't fully matched)? I checked arrow-rs (parquet 58.3.0 + latest main), but per RG page index apis doesn't seem to be avalible. We can take that implementation as a next setp to this(not sure though per page index skip would be that much beneficial or not). |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Rationale for this change
The Parquet opener was loading the page index (ColumnIndex + OffsetIndex) before row-group statistics pruning. When all surviving row groups are fully matched by row-group statistics (for example,
IS NOT NULLon a non-null column), page index I/O cannot prune further and is wasted.What changes are included in this PR?
PrepareFilters → PruneWithStatistics → LoadPageIndex? → LoadBloomFiltersload_page_indexwhen there is no page-pruning predicate, no surviving row groups, or every surviving row group is fully matchedIS NOT NULLcaseAre these changes tested?
cargo test -p datafusion-datasource-parquet should_loadcargo test -p datafusion-datasource-parquet page_index_skipcargo test -p datafusion-datasource-parquet opener::test::test_page_pruningcargo test -p datafusion --test parquet_integrationcargo clippy -p datafusion-datasource-parquet --all-targets -- -D warningsAre there any user-facing changes?
No user-facing API changes. This reduces unnecessary Parquet page index I/O during scan planning when row-group statistics already prove no further pruning is possible.
Made with Cursor