You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "wangyum (via GitHub)" <gi...@apache.org> on 2023/08/15 14:36:15 UTC

[GitHub] [spark] wangyum commented on a diff in pull request #42488: [SPARK-44804][SQL] SortMergeJoin should respect the streamed side ordering

wangyum commented on code in PR #42488:
URL: https://github.com/apache/spark/pull/42488#discussion_r1294681915


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoinExec.scala:
##########
@@ -58,10 +65,10 @@ case class SortMergeJoinExec(
         // Also add expressions from right side sort order
         val sameOrderExpressions = ExpressionSet(lKey.sameOrderExpressions ++ rKey.children)
         SortOrder(lKey.child, Ascending, sameOrderExpressions.toSeq)
-      }
+      } ++ streamedOrdering()
     // For left and right outer joins, the output is ordered by the streamed input's join keys.
-    case LeftOuter => getKeyOrdering(leftKeys, left.outputOrdering)
-    case RightOuter => getKeyOrdering(rightKeys, right.outputOrdering)
+    case LeftOuter => getKeyOrdering(leftKeys, left.outputOrdering) ++ streamedOrdering()
+    case RightOuter => getKeyOrdering(rightKeys, right.outputOrdering) ++ streamedOrdering()

Review Comment:
   Could we fix the issue in the getKeyOrdering method?



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