ulysses-you commented on a change in pull request #35924:
URL: https://github.com/apache/spark/pull/35924#discussion_r832240437



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala
##########
@@ -2575,6 +2575,22 @@ class AdaptiveQueryExecSuite
       assert(findTopLevelAggregate(adaptive5).size == 4)
     }
   }
+
+  test("SPARK-38578: Avoid unnecessary sort in FileFormatWriter if user has 
specified sort") {
+    Seq(
+      ("key", "key, value", false),
+      ("key as x", "key, value", false),
+      ("key", "key", true),
+      ("key, value", "key", true)
+    ).foreach { case (project, sort, required) =>
+      val (origin, adaptive) = runAdaptiveAndVerifyResult(
+        s"""
+           |SELECT $project FROM testdata where key < 0 ORDER BY $sort

Review comment:
       this test ensure we will add sort back if need.




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