davidm-db commented on code in PR #49006:
URL: https://github.com/apache/spark/pull/49006#discussion_r1871239866
##########
sql/core/src/main/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionNode.scala:
##########
@@ -244,6 +287,9 @@ class CompoundBodyExec(statements:
Seq[CompoundStatementExec], label: Option[Str
// Stop the iteration.
stopIteration = true
+ // Exit scope if leave statement is encountered.
+ exitScope()
Review Comment:
need `exitScope` in `handleIterateStatement` as well.
Iterate statement wouldn't be for the compound body (we forbid that), but
can be for the parent loop for example. In such case, we still want to exit the
scope so that in the next iteration of the loop it's properly entered
--
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]