Resolve page pruning StatisticsConverter once per file instead of once per row group - #24182
Draft
alamb wants to merge 2 commits into
Draft
Resolve page pruning StatisticsConverter once per file instead of once per row group#24182alamb wants to merge 2 commits into
StatisticsConverter once per file instead of once per row group#24182alamb wants to merge 2 commits into
Conversation
The footer metadata records the column/offset index offsets even when the page index itself has not been loaded. If no offsets are present the file has no page index and attempting to load it can never succeed, so avoid the deep clone of ParquetMetaData in that case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…roup Hoist the per-predicate StatisticsConverter construction (which resolves the parquet leaf column via a linear scan of both schemas in parquet_column) out of the row-group loop in prune_plan_with_page_index_and_metrics, so the resolution happens once per predicate per file instead of once per (predicate, row group). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24182 +/- ##
========================================
Coverage 81.06% 81.06%
========================================
Files 1106 1106
Lines 382252 382356 +104
Branches 382252 382356 +104
========================================
+ Hits 309856 309960 +104
+ Misses 54090 54088 -2
- Partials 18306 18308 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Note: this PR is stacked on #24150 -- please review only the final commit until that merges.
Which issue does this PR close?
ParquetMetaDataclone) when the file has no page index #24150)Rationale for this change
During page index pruning,
prune_plan_with_page_index_and_metricscreates aStatisticsConverterfor each predicate inside the per-row-group loop. Each construction callsparquet_column, which does a linear scan of both the Arrow schema fields and the Parquet leaf columns to resolve the predicate column, so the same column resolution is recomputed once per(predicate, row group).For files with many row groups this adds up: the single-file ClickBench
hits.parquethas 226 row groups and 105 columns, so a query with 2 pushed-down predicate columns resolved the same 2 columns 452 times per file open.What changes are included in this PR?
(predicate, StatisticsConverter)construction out of the row-group loop so each predicate column is resolved once per file, and pass the converter down by reference (prune_pages_in_one_row_groupandPagesPruningStatisticsnow borrow it).Are these changes tested?
Covered by existing tests:
datafusion-datasource-parquetlib tests and thepage_pruningintegration tests indatafusion/core/tests/parquet/all pass. No behavior change intended.Are there any user-facing changes?
No.