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



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala
##########
@@ -102,6 +103,14 @@ case class AdaptiveSparkPlanExec(
     OptimizeLocalShuffleReader(conf)
   )
 
+  @transient private val finalStageOptimizerRules: Seq[Rule[SparkPlan]] =
+    context.qe.sparkPlan match {
+      case _: DataWritingCommandExec =>

Review comment:
       we need to match all writing commands, including DS v1, v2 and file 
source. Maybe we can create a tagging trait like `UserDefinedExpression`, to 
tag these writing commands.

##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala
##########
@@ -102,6 +103,14 @@ case class AdaptiveSparkPlanExec(
     OptimizeLocalShuffleReader(conf)
   )
 
+  @transient private val finalStageOptimizerRules: Seq[Rule[SparkPlan]] =
+    context.qe.sparkPlan match {
+      case _: DataWritingCommandExec =>
+        
queryStageOptimizerRules.filterNot(_.isInstanceOf[OptimizeLocalShuffleReader])

Review comment:
       let's add comments to explain it.




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

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