EnricoMi commented on code in PR #38358:
URL: https://github.com/apache/spark/pull/38358#discussion_r1008881156


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileFormatWriter.scala:
##########
@@ -187,8 +188,17 @@ object FileFormatWriter extends Logging {
     // We should first sort by partition columns, then bucket id, and finally 
sorting columns.
     val requiredOrdering =
       partitionColumns ++ writerBucketSpec.map(_.bucketIdExpression) ++ 
sortColumns
+
+    // SPARK-40588: plan may contain an AdaptiveSparkPlanExec, which does not 
know
+    // its final plan's ordering, so we have to materialize that plan first
+    def materializeAdaptiveSparkPlan(plan: SparkPlan): SparkPlan = plan match {

Review Comment:
   `V1WriteCommand` is a concept introduced after Spark 3.3. The issue 
addressed in this PR does not exist post Spark 3.3 as the `FieFormatWriter` 
does not see `AdaptiveSparkPlanExec` but the final plan (exactly what this 
change is trying to achieve).



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