[GitHub] [spark] allisonwang-db commented on a change in pull request #29137: [SPARK-32337][SQL] Show initial plan in AQE plan tree string
allisonwang-db commented on a change in pull request #29137: URL: https://github.com/apache/spark/pull/29137#discussion_r466043640 ## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala ## @@ -279,34 +280,69 @@ case class AdaptiveSparkPlanExec( prefix: String = "", addSuffix: Boolean = false, maxFields: Int, - printNodeId: Boolean): Unit = { -super.generateTreeString(depth, + printNodeId: Boolean, + indent: Int = 0): Unit = { +super.generateTreeString( + depth, lastChildren, append, verbose, prefix, addSuffix, maxFields, + printNodeId, + indent) +generateTreeStringWithHeader( + if (isFinalPlan) "Final Plan" else "Current Plan", Review comment: Since `EXPLAIN FORMATTED` will not actually execute the query, we use `Current Plan` to indicate the *current* query plan, and when the current adaptive query plan is final, we will use `Final Plan`. 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: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] allisonwang-db commented on a change in pull request #29137: [SPARK-32337][SQL] Show initial plan in AQE plan tree string
allisonwang-db commented on a change in pull request #29137: URL: https://github.com/apache/spark/pull/29137#discussion_r459784186 ## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala ## @@ -288,25 +291,59 @@ case class AdaptiveSparkPlanExec( addSuffix, maxFields, printNodeId) -currentPhysicalPlan.generateTreeString( +plans.zipWithIndex.foreach { case ((name, plan), i) => Review comment: I tried wrapping the plan with a dummy node but it won't work with having the header printed on the same line as the top node without changing the `generateTreeString` method itself. The suggestion makes sense, will update the code. 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: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] allisonwang-db commented on a change in pull request #29137: [SPARK-32337][SQL] Show initial plan in AQE plan tree string
allisonwang-db commented on a change in pull request #29137: URL: https://github.com/apache/spark/pull/29137#discussion_r459784186 ## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala ## @@ -288,25 +291,59 @@ case class AdaptiveSparkPlanExec( addSuffix, maxFields, printNodeId) -currentPhysicalPlan.generateTreeString( +plans.zipWithIndex.foreach { case ((name, plan), i) => Review comment: The implementation exposed the internal implementation for generateTreeString, which is not ideal. I've tried wrapping the plan with a dummy node but it won't work with having the header printed on the same line as the top node without hacking `generateTreeString`. The suggestion makes sense, will update the code. 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: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org
[GitHub] [spark] allisonwang-db commented on a change in pull request #29137: [SPARK-32337][SQL] Show initial plan in AQE plan tree string
allisonwang-db commented on a change in pull request #29137: URL: https://github.com/apache/spark/pull/29137#discussion_r459784186 ## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala ## @@ -288,25 +291,59 @@ case class AdaptiveSparkPlanExec( addSuffix, maxFields, printNodeId) -currentPhysicalPlan.generateTreeString( +plans.zipWithIndex.foreach { case ((name, plan), i) => Review comment: The current implementation exposes the internal implementation for generateTreeString, which is not ideal. I've tried wrapping the plan with a dummy node but it won't work with having the header printed on the same line as the top node without hacking `generateTreeString`. The suggestion makes sense, will update the code. 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: us...@infra.apache.org - To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org