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/04/13 17:26:22 UTC

[GitHub] [spark] sigmod commented on a diff in pull request #36180: [SPARK-38887][SQL] Support switch inner join side for sort merge join

sigmod commented on code in PR #36180:
URL: https://github.com/apache/spark/pull/36180#discussion_r849726412


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala:
##########
@@ -236,8 +236,10 @@ abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
 
         def createSortMergeJoin() = {
           if (RowOrdering.isOrderable(leftKeys)) {
-            Some(Seq(joins.SortMergeJoinExec(
-              leftKeys, rightKeys, joinType, nonEquiCond, planLater(left), planLater(right))))
+            val (streamed, buffered) = getSortMergeJoinStreamedAndBufferedSide(joinType, leftKeys,
+              left, right, conf)
+            Some(Seq(joins.SortMergeJoinExec(leftKeys, rightKeys, joinType, nonEquiCond,

Review Comment:
   Just curious: does the order of output attributes matter?
   
   https://github.com/apache/spark/blob/d8920ae13346670bac3f1a7e49dfc2ba85c93b03/sql/core/src/main/scala/org/apache/spark/sql/execution/joins/ShuffledJoin.scala#L62
   
   iiuc, BHJ has an BuildSide enum and doesn't actually switch left/right children so it doesn't have this problem?
   



-- 
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