perf: nested struct statistics pruning - #5772
Draft
peterxcli wants to merge 3 commits into
Draft
Conversation
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?
Related to #5739 and #5553. This draft demonstrates nested-field statistics pruning, but does not close either issue: checked
TIMESTAMP_MILLISconversion and Spark filtering parity still need separate work.Rationale for this change
Comet already serializes nested predicates, but its custom
GetStructFieldexpression does not expose DataFusion's field-access capability. A selectives.inner.kfilter therefore reads all row groups even when leaf statistics can exclude most of them.This draft connects Comet to peterxcli/datafusion#2 to demonstrate the performance and correctness of the integration. It pins that DataFusion fork and needs the upstream dependency work before it is ready to merge.
On a synthetic local Parquet file with 4,194,304 rows and 64 row groups, the selective nested query improves from 642.3 ms to 182.6 ms (3.52x). It prunes 63/64 row groups and reduces reader bytes from 182,481,422 to 2,851,301 (98.4% less), with identical aggregate checksums.
Disabling pruning in the candidate restores all 64 groups and baseline reader bytes, with a 638.0 ms median over five control measurements. The other matched comparisons differ by less than 2%, with overlapping interquartile ranges.
These are warm-cache measurements on an AMD EPYC 7282 host with Spark 4.1.3,
local[1], matching release build settings, and 20 samples per revision in alternating run order. Timings include SQL planning, execution, and collecting the result. Every measured plan usesCometNativeScan. This does not establish production or object-storage speedups, or improvements for arrays, maps, Variant, or unfiltered scans.What changes are included in this PR?
0b0506a9acab9d5892ecf7e89243c3b34664bcc6.GetStructFieldplanning through the adapter and add a real scan regression for nested statistics pruning.benchmarks/nested-pruning.How are these changes tested?
Build, test, and benchmark results were collected against Comet
bb9e74020adc228e486f6f4d0fa68292b30bff31and the patch on that base. The baseline uses its checked-in DataFusion 55.0.0 dependencies, so the comparison includes both the DataFusion fork and the Comet adapter. Before publication, the patch was rebased unchanged onto5af898b2e(the intervening Iceberg unknown-transform fix);git range-diffconfirms an identical patch. Formatting and diff checks were repeated after the rebase; builds and benchmark timings were not rerun.