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/22 12:53:26 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #35924: [SPARK-38578][SQL] Avoid unnecessary sort in FileFormatWriter if user has specified sort in AQE

cloud-fan commented on a change in pull request #35924:
URL: https://github.com/apache/spark/pull/35924#discussion_r832139049



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEUtils.scala
##########
@@ -57,4 +58,24 @@ object AQEUtils {
       }
     case _ => Some(UnspecifiedDistribution)
   }
+
+  // Analyze the given plan and calculate the required ordering of this plan w.r.t. the
+  // user-specified sort.
+  def getRequiredOrdering(p: SparkPlan): Seq[SortOrder] = p match {
+    case f: FilterExec => getRequiredOrdering(f.child)

Review comment:
       Let's put the similar code comments in `getRequiredDistribution`:
   ```
   // User-specified repartition is only effective when it's the root node, or under
   ...
   ```




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