[SPARK-55551][SQL] Improve BroadcastHashJoinExec output partitioning#54335
Open
peter-toth wants to merge 1 commit intoapache:masterfrom
Open
Conversation
peter-toth
commented
Feb 16, 2026
| HashPartitioning(Seq(l3), 1)))), | ||
| right = DummySparkPlan()) | ||
| expected = PartitioningCollection(Seq( | ||
| PartitioningCollection(Seq( |
Contributor
Author
There was a problem hiding this comment.
Keeping a PartitioningCollection in a PartitioningCollection has no benefit.
| @@ -96,28 +97,23 @@ case class BroadcastHashJoinExec private( | |||
| } | |||
|
|
|||
| // Expands the given partitioning collection recursively. | |||
Member
There was a problem hiding this comment.
Could you revise this method description a little more according to your code change? The method is slightly changed to handle Partitioning instead of PartitionCollection.
| // where the streamed keys are Seq("b", "c") and the build keys are Seq("x", "y"), | ||
| // the expanded partitioning will have the following expressions: | ||
| // Seq("a", "b", "c"), Seq("a", "b", "y"), Seq("a", "x", "c"), Seq("a", "x", "y"). | ||
| // The expanded expressions are returned as PartitioningCollection. |
Member
There was a problem hiding this comment.
- // The expanded expressions are returned as PartitioningCollection.
+ // The expanded expressions are returned as Seq[Partitioning].| case other => other | ||
| val expandedPartitioning = expandOutputPartitioning(streamedPlan.outputPartitioning) | ||
| expandedPartitioning match { | ||
| case Nil => UnknownPartitioning(streamedPlan.outputPartitioning.numPartitions) |
Member
There was a problem hiding this comment.
This logic looks new to me. Is this an improvement?
Member
dongjoon-hyun
left a comment
There was a problem hiding this comment.
The refactoring itself looks reasonable to me. I have a few comments.
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.
What changes were proposed in this pull request?
This is a minor refector of
BroadcastHashJoinExec.outputPartitioningto:Partitioning with Expressioninstead ofHashPartitioningLike.Why are the changes needed?
Code cleanup and add support for future partitionings that implement
Expressionbut notHashPartitioningLike. (LikeKeyedPartitioningis in #54330.)Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing tests.
Was this patch authored or co-authored using generative AI tooling?
No.