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



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/debug/package.scala
##########
@@ -112,6 +113,19 @@ package object debug {
       plan foreach {
         case s: WholeStageCodegenExec =>
           codegenSubtrees += s
+        case p: AdaptiveSparkPlanExec =>
+          // Find subtrees from current executed plan of AQE.
+          val executedPlan = p.executedPlan
+          if 
(executedPlan.find(_.isInstanceOf[WholeStageCodegenExec]).isEmpty) {

Review comment:
       Ah, now I see what you mean. For `isFinalPlan=false`, we may have query 
stages in the query plan that do not run `queryStageOptimizerRules` yet, and 
have no `WholeStageCodegenExec`.
   
   I think this is at least consistent with normal EXPLAIN. If the `df` is not 
run yet, you won't see the leading `*` in plan nodes that indicate whole-stage 
codegen.
   
   One idea is to trigger AQE during EXPLAIN, so that we can display the final 
plan. But this won't work for SQL EXPLAIN.




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