-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-37592][SQL] Improve performance of JoinSelection
#34844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
aa49f15
56919dc
0e82c06
3ce77ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -266,11 +266,15 @@ abstract class SparkStrategies extends QueryPlanner[SparkPlan] { | |
| } | ||
| } | ||
|
|
||
| createBroadcastHashJoin(true) | ||
| .orElse { if (hintToSortMergeJoin(hint)) createSortMergeJoin() else None } | ||
| .orElse(createShuffleHashJoin(true)) | ||
| .orElse { if (hintToShuffleReplicateNL(hint)) createCartesianProduct() else None } | ||
| .getOrElse(createJoinWithoutHint()) | ||
| if (hint.isEmpty) { | ||
| createJoinWithoutHint() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change LGTM
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we do this in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK |
||
| } else { | ||
| createBroadcastHashJoin(true) | ||
| .orElse { if (hintToSortMergeJoin(hint)) createSortMergeJoin() else None } | ||
| .orElse(createShuffleHashJoin(true)) | ||
| .orElse { if (hintToShuffleReplicateNL(hint)) createCartesianProduct() else None } | ||
| .getOrElse(createJoinWithoutHint()) | ||
| } | ||
|
|
||
| case j @ ExtractSingleColumnNullAwareAntiJoin(leftKeys, rightKeys) => | ||
| Seq(joins.BroadcastHashJoinExec(leftKeys, rightKeys, LeftAnti, BuildRight, | ||
|
|
@@ -339,10 +343,13 @@ abstract class SparkStrategies extends QueryPlanner[SparkPlan] { | |
| } | ||
| } | ||
|
|
||
| createBroadcastNLJoin(hintToBroadcastLeft(hint), hintToBroadcastRight(hint)) | ||
| .orElse { if (hintToShuffleReplicateNL(hint)) createCartesianProduct() else None } | ||
| .getOrElse(createJoinWithoutHint()) | ||
|
|
||
| if (hint.isEmpty) { | ||
| createJoinWithoutHint() | ||
| } else { | ||
| createBroadcastNLJoin(hintToBroadcastLeft(hint), hintToBroadcastRight(hint)) | ||
| .orElse { if (hintToShuffleReplicateNL(hint)) createCartesianProduct() else None } | ||
| .getOrElse(createJoinWithoutHint()) | ||
| } | ||
|
|
||
| // --- Cases where this strategy does not apply --------------------------------------------- | ||
| case _ => Nil | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this related to
JoinSelection?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just simplify the code.