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 2020/07/17 03:39:27 UTC

[GitHub] [spark] maryannxue commented on a change in pull request #29134: [SPARK-32332][SQL] Support columnar exchanges when AQE is enabled

maryannxue commented on a change in pull request #29134:
URL: https://github.com/apache/spark/pull/29134#discussion_r456200591



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala
##########
@@ -374,12 +374,14 @@ case class AdaptiveSparkPlanExec(
   }
 
   private def newQueryStage(e: Exchange): QueryStageExec = {
-    val optimizedPlan = applyPhysicalRules(e.child, queryStageOptimizerRules)
+    // apply optimizer rules to the Exchange node and its children, allowing plugins to be
+    // able to replace the Exchange node itself
+    val optimizedPlan = applyPhysicalRules(e, queryStageOptimizerRules)

Review comment:
       I think it's safer to use `s.withNewChildren(optimizedChildPlan)` than adding special handling in those physical rules: https://github.com/apache/spark/pull/29134/files#diff-a30c7a6fcdcdd13e57135fd04d05f3b7R115-R117
   
   That saves you the trouble of worrying about certain assumptions being broken in an arbitrary rule.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org