Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26441 +/- ##
========================================
Coverage 82.89% 82.90%
========================================
Files 1154 1154
Lines 457620 457778 +158
Branches 457620 457778 +158
========================================
+ Hits 379352 379520 +168
+ Misses 55262 55249 -13
- Partials 23006 23009 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rgbuilds
marked this pull request as ready for review
October 17, 2026 07:04
Contributor
Author
|
@andygrove This is ready for review and addresses #26130 by pruning files before grouping, using already collected statistics. Would appreciate your feedback when you have time. |
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?
Closes #26130.
Rationale for this change
When files contain disjoint ranges of a filtered column, ListingTable groups all files before file-statistics pruning. The matching files can therefore land in a single scan partition, and scan statistics still include files that cannot match.
In the eight-file example from the issue,
d >= 20 AND d < 40currently places both matching files in the second of four groups and estimates 80 rows. Pruning before grouping retains onlyf2andf3, puts them in separate groups, and aggregates 20 survivor rows.What changes are included in this PR?
PruningPredicateBuilderwith already collected file statistics before splitting regular scan file groups.What is the testing strategy for this PR?
On the investigated baseline (
a4b8198cf), local validation passed 12,579 distinct Rust tests and 533 SQL logic files. This includes 23 listing unit tests, 10 focused pruning integration tests, all 246 Parquet integration tests, and 126 extended fuzz tests. The no-extra-I/O test compares object-store requests during planning.Coverage includes the eight-file grouping example, partially matching files, missing and inexact bounds, NULL semantics, Hash/Range partition layouts, Hive/data predicates, LIMIT/OFFSET, custom adapters, volatile UDF invocation counts, survivor statistics, and conservative filtered-statistics precision. Nine SQL snapshot files change physical-plan expectations only.
On current upstream main (
5f2158269), all 1,459 core integration tests (including all 10 pruning regressions and the no-extra-I/O test), all 247 Parquet tests, and all 535 SQL logic files pass. The full extended workspace run completed successfully: 12,742 Rust tests passed, including all 126 fuzz tests, with eight tests ignored and no failures. All 535 SQL logic files also passed. Formatting, diff whitespace, TOML formatting, and license headers on all 2,331 tracked project source files pass.The earlier full workspace Clippy run passed with explicit allowances for pre-existing upstream/toolchain diagnostics. The mandatory strict Clippy invocation also fails on the updated main branch with Rust 1.99, on three pre-existing
clippy::mutable_key_typediagnostics in untoucheddatafusion/optimizer/src/push_down_filter.rs. The CI-style Clippy invocation (--workspace --all-targets --features avro,integration-tests,extended_tests -- -D warnings) passes. The full lint wrapper stops at its license walk because locally exported third-party SQLite fixture snapshots lack project headers; the separate tracked-project-source license check passes. Subsequent wrapper steps have not been run. No lint suppression or unrelated optimizer change is included in this PR. No performance speedup is claimed: the prior Hive-only planning benchmark is not representative of data-column pruning and ran under differing concurrent load.Are there any user-facing changes?
With statistics collection enabled, regular listing scans can contain fewer files and report tighter statistics in EXPLAIN. Query results and row filtering are unchanged. Unsupported or inconclusive statistics keep files, and declared partition layouts are preserved.
This contribution was developed with AI assistance. The design and safeguards are described above; performance under distributed execution remains unmeasured.