You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/10/13 10:53:59 UTC
[GitHub] [spark] ulysses-you commented on a diff in pull request #38176: [SPARK-40715][SQL] Support selecting shuffled hash join thought LocalMapThreshold is less than advisory partition size
ulysses-you commented on code in PR #38176:
URL: https://github.com/apache/spark/pull/38176#discussion_r994485856
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/DynamicJoinSelection.scala:
##########
@@ -89,13 +111,19 @@ object DynamicJoinSelection extends Rule[LogicalPlan] with JoinSelectionHelper {
false
}
- val preferShuffleHash = preferShuffledHashJoin(stage.mapStats.get)
+ val preferShuffleHash = streamedPlan match {
+ case LogicalQueryStage(_, streamedStage: ShuffleQueryStageExec)
+ if streamedStage.isMaterialized && streamedStage.mapStats.isDefined =>
+ preferShuffledHashJoin(stage.mapStats.get, streamedStage.mapStats.get)
+
+ case _ => false
Review Comment:
this will be regression.. it prevents multi-join convert to shj, e.g.:
```
SortMergejoin 2
SortMergeJoin 1
Shuffle 1
Shuffle 2
Shuffe 3
```
The join 2 can not convert to shj even shuffle 3 is small
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org