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/03/23 04:14:55 UTC

[GitHub] [spark] ulysses-you commented on a change in pull request #35924: [SPARK-38578][SQL] AdaptiveSparkPlanExec should ensure user-specified ordering

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



##########
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:
       added some comments to describe the test




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