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


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala:
##########
@@ -1372,6 +1372,28 @@ class PlannerSuite extends SharedSparkSession with 
AdaptiveSparkPlanHelper {
       assert(numOutputPartitioning.size == 8)
     }
   }
+
+  test("SPARK-44804: SortMergeJoin should respect the streamed side ordering") 
{

Review Comment:
   1. Move the test after `EnsureRequirements adds sort when required ordering 
isn't a prefix of existing ordering`?
   2. Could we change the test to something like the following?
   ```scala
       val plan1 = DummySparkPlan(outputOrdering = Seq(orderingA, orderingB),
         outputPartitioning = HashPartitioning(exprA :: Nil, 5))
       val plan2 = DummySparkPlan(outputOrdering = Seq(orderingB, orderingC, 
orderingA),
         outputPartitioning = HashPartitioning(exprB :: Nil, 5))
   
       Seq(Inner ... ).foreach { joinType =>
         val fullSmj = SortMergeJoinExec(exprA :: Nil, exprB :: Nil, joinType, 
None, plan1, plan2)
         // assert
       }
   ```



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