Repository navigation
Spark 4.2: Drop dynamic pruning filters that nest pruning filters - #49
Merged
Merged
Conversation
Spark adds one pruning subquery per join that can prune a scan, holding the plan of the join's other side. When a common table expression joins with itself, each subquery copies the subqueries of that side, and the plan grows by a factor of three per level of joins: five levels on a partition column give 121 pruning filters. The Iceberg session extensions now install NestedDynamicPruning, which drops each pruning filter whose filtering plan holds pruning filters of its own. A pruning filter only skips rows that the join drops, so the result does not change. Signed-off-by: Robert Kruszewski <github@robertk.io>
robert3005
added a commit
that referenced
this pull request
Nov 25, 2026
Main gained the NestedDynamicPruning rule (#49), which this branch already has. The rule keeps the branch's comments, because here it also lets scans offer data columns to dynamic pruning. The test keeps both cases: the partition column test from main and the data column test from this branch. Generated-by: Claude Code
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.
Summary
NestedDynamicPruning, which drops each dynamic pruning filter whose filtering plan holds pruning filters of its own. The Iceberg session extensions install it.Checks
TestNestedDynamicPruningpasses on Spark 4.2 (8 tests). Without the rule, the plan of the test query has 121 pruning filters, which is above the limit of 20 in the test.spotlessApplyon the two Spark 4.2 modules.🤖 Generated with Claude Code
https://claude.ai/code/session_018SWbEtEQLKKebxSCarAZrU