davidm-db commented on code in PR #49006:
URL: https://github.com/apache/spark/pull/49006#discussion_r1871235005


##########
sql/core/src/main/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionNode.scala:
##########
@@ -210,6 +243,10 @@ class CompoundBodyExec(statements: 
Seq[CompoundStatementExec], label: Option[Str
             statement
           case Some(body: NonLeafStatementExec) =>
             if (body.getTreeIterator.hasNext) {
+              body match {
+                case exec: CompoundBodyExec => exec.enterScope()

Review Comment:
   nit: maybe a small comment explaining that this will actually be executed 
only once per scope, due to the logic in `enterScope`



-- 
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: [email protected]

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