cloud-fan commented on code in PR #40734: URL: https://github.com/apache/spark/pull/40734#discussion_r1162890868
########## sql/core/src/main/scala/org/apache/spark/sql/execution/command/commands.scala: ########## @@ -163,8 +164,11 @@ case class ExplainCommand( // Run through the optimizer to generate the physical plan. override def run(sparkSession: SparkSession): Seq[Row] = try { - val outputString = sparkSession.sessionState.executePlan(logicalPlan, CommandExecutionMode.SKIP) - .explainString(mode) + val qe = sparkSession.sessionState.executePlan(logicalPlan, CommandExecutionMode.SKIP) + val outputString = qe.explainString(mode) + qe.executedPlan.foreach { + case staged: HasStagedChanges => staged.abortStagedChanges() Review Comment: it's a bit weird to abort the staged changes in EXPLAIN command. -- 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: reviews-unsubscr...@spark.apache.org 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