Resolve page pruning StatisticsConverter once per file instead of once per row group - #24182
Resolve page pruning StatisticsConverter once per file instead of once per row group#24182alamb wants to merge 1 commit into
StatisticsConverter once per file instead of once per row group#24182Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24182 +/- ##
==========================================
- Coverage 80.99% 80.99% -0.01%
==========================================
Files 1106 1106
Lines 383344 383350 +6
Branches 383344 383350 +6
==========================================
- Hits 310484 310478 -6
- Misses 54543 54550 +7
- Partials 18317 18322 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…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>
7f46ba2 to
ef5666b
Compare
|
run benchmark clickbench_1 clickbench_partitioned |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing cache_parquet_column (ef5666b) to f6879b4 (merge-base) diff Run configurationrun benchmark clickbench_1Results will be posted here when complete File an issue against this benchmark runner |
|
🤖 Benchmark running (GKE) | trigger CPU Details (lscpu)Comparing cache_parquet_column (ef5666b) to f6879b4 (merge-base) diff Run configurationrun benchmark clickbench_partitionedResults will be posted here when complete File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing cache_parquet_column (ef5666b) to f6879b4 (merge-base) diff Run configurationrun benchmark clickbench_partitionedCPU Details (lscpu)Details
Resource Usageclickbench_partitioned — base (merge-base)
clickbench_partitioned — branch
File an issue against this benchmark runner |
|
🤖 Benchmark completed (GKE) | trigger Instance: Comparing cache_parquet_column (ef5666b) to f6879b4 (merge-base) diff Run configurationrun benchmark clickbench_1CPU Details (lscpu)Details
Resource Usageclickbench_1 — base (merge-base)
clickbench_1 — branch
File an issue against this benchmark runner |
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.