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


##########
sql/core/src/main/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionNode.scala:
##########
@@ -187,6 +199,19 @@ abstract class 
CompoundNestedStatementIteratorExec(collection: Seq[CompoundState
     collection.foreach(_.reset())
     localIterator = collection.iterator
     curr = if (localIterator.hasNext) Some(localIterator.next()) else None
+    stopIteration = false
+  }
+
+  private def handleLeaveStatement(leaveStatement: LeaveStatementExec): Unit = 
{
+    if (!leaveStatement.hasBeenMatched) {
+      // Stop the iteration.
+      stopIteration = true
+
+      // TODO: Variable cleanup (once we add SQL script execution logic).

Review Comment:
   Will be done once we introduce execution. For now, we are adding 
`DropVariable` statements at the end of each block implicitly. However, 
introduction of `LEAVE` and `ITERATE` statements means that these implicit 
statements will be skipped and we need to add logic to execute them 
immediately. Currently, we cannot do so, because execution nodes don't have 
execution logic yet.



-- 
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