fix: preserve range partitioning through joins#23584
Open
EdsonPetry wants to merge 1 commit into
Open
Conversation
Contributor
Author
gene-bordegaray
approved these changes
Jul 14, 2026
Contributor
There was a problem hiding this comment.
could we add one test for sort merge joins too, maybe do this one in slt with going into another join
other than that looks good 👍
eit we will have to wait for #23480 to land for that test but think it is worth it for coverage
Contributor
|
cc: @gabotechs |
gabotechs
approved these changes
Jul 15, 2026
Comment on lines
+154
to
+156
| let ordering = LexOrdering::new(ordering) | ||
| .expect("offsetting a range ordering keeps it non-empty"); | ||
| Partitioning::Range(RangePartitioning::new( |
Contributor
There was a problem hiding this comment.
Rather than panicking, can we through a controlled internal error here?
Contributor
Author
There was a problem hiding this comment.
Makes sense, thanks!
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?
Partitioning::Rangeoutput partitioning through joins #23450.Rationale for this change
#23184 allowed compatible range-partitioned inputs to satisfy partitioned inner joins without hash repartitioning. However, join output still downgraded
Partitioning::RangetoUnknownPartitioning, so downstream joins and aggregates could not reuse the preserved range layout and inserted avoidable hash repartitions.What changes are included in this PR?
Partitioning::Rangeinadjust_right_output_partitioning.Are these changes tested?
Yes.
./dev/rust_lint.shcargo clippy --all-targets --all-features -- -D warningscargo test -p datafusion-physical-plan test_adjust_right_output_partitioning_preserves_rangecargo test --profile=ci --test sqllogictests -- range_partitioning.sltulimit -n 10240 && RUST_BACKTRACE=1 cargo test --profile ci --exclude datafusion-examples --exclude datafusion-benchmarks --exclude datafusion-cli --workspace --lib --tests --bins --features avro,json,backtrace,extended_tests,recursive_protection,parquet_encryptionAre there any user-facing changes?
Yes. Physical plans can preserve proven range partitioning through joins, allowing compatible downstream joins and aggregates to avoid unnecessary hash repartitioning. There are no public API changes.