miland-db commented on code in PR #53530:
URL: https://github.com/apache/spark/pull/53530#discussion_r2737592270


##########
sql/core/src/main/scala/org/apache/spark/sql/scripting/SqlScriptingExecution.scala:
##########
@@ -186,7 +186,7 @@ class SqlScriptingExecution(
       }
     }
     // If there are still frames available, get the next statement.
-    if (context.frames.nonEmpty) {
+    if (context.frames.nonEmpty && context.frames.last.hasNext) {

Review Comment:
   Above while loop guarantees that if `context.frames.nonEmpty`, 
`context.frames.last.hasNext` will be true.



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