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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to