Conversation
stuhood
force-pushed
the
stuhood.do-not-broadcast-when-copartitioned
branch
from
September 15, 2026 03:39
1979696 to
4735398
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #25304 +/- ##
==========================================
- Coverage 81.91% 81.91% -0.01%
==========================================
Files 1134 1134
Lines 425708 425722 +14
Branches 425708 425722 +14
==========================================
+ Hits 348726 348729 +3
Misses 56305 56305
- Partials 20677 20688 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stuhood
marked this pull request as ready for review
September 15, 2026 04:38
27 tasks
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?
Rationale for this change
In
JoinSelection,try_collect_leftconverts a hash join toPartitionMode::CollectLeft(broadcast) when either input is below configured byte/row thresholds. However, if the inputs are already co-partitioned on the join keys across multiple partitions (e.g. both partitioned by hash on the join keys or by range with matching boundaries), switching toCollectLeftintroduces an unnecessaryCoalescePartitionsand broadcasts data across partitions or cluster nodes.Preserving
PartitionMode::Partitionedwhen the inputs already satisfy the partitioned distribution requirements allows the join to execute locally within each partition with zero shuffles or network transfers.What changes are included in this PR?
HashJoinExec::partitioned_input_distribution_requirementsandHashJoinExec::inputs_satisfy_partitioned_requirementsindatafusion/physical-plan/src/joins/hash_join/exec.rs.JoinSelection::try_collect_left(datafusion/physical-optimizer/src/join_selection.rs), skip converting toCollectLeftif inputs already satisfy partitioned distribution requirements across >1 partition.What is the testing strategy for this PR?
New unit tests.
Are there any user-facing changes?
No.