ulysses-you commented on code in PR #47224: URL: https://github.com/apache/spark/pull/47224#discussion_r1667870238
########## sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala: ########## @@ -129,7 +129,15 @@ class QueryExecution( qe.commandExecuted, qe.executedPlan, result.toImmutableArraySeq) - case other => other + } + p transformDown { + case u @ Union(children, _, _) if children.forall(_.isInstanceOf[Command]) => + eagerlyExecute(u, "commands", CommandExecutionMode.SKIP) Review Comment: `commands` -> `multi-commands` ########## sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala: ########## @@ -129,7 +129,15 @@ class QueryExecution( qe.commandExecuted, qe.executedPlan, result.toImmutableArraySeq) - case other => other + } + p transformDown { + case u @ Union(children, _, _) if children.forall(_.isInstanceOf[Command]) => + eagerlyExecute(u, "commands", CommandExecutionMode.SKIP) + case c: Command => + val name = commandExecutionName(c) + eagerlyExecute(c, name, CommandExecutionMode.NON_ROOT) + case other => other Review Comment: nit: unnecessary default pattern ########## sql/core/src/main/scala/org/apache/spark/sql/execution/QueryExecution.scala: ########## @@ -110,15 +110,15 @@ class QueryExecution( case _ => "command" } - private def eagerlyExecuteCommands(p: LogicalPlan) = p transformDown { - case c: Command => + private def eagerlyExecuteCommands(p: LogicalPlan) = { + def eagerlyExecute(p: LogicalPlan, + name: String, mode: CommandExecutionMode.Value): LogicalPlan = { Review Comment: ```scala def eagerlyExecute( p: LogicalPlan, name: String, mode: CommandExecutionMode.Value) ``` -- 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