miland-db commented on code in PR #49427:
URL: https://github.com/apache/spark/pull/49427#discussion_r1928615988
##########
sql/core/src/main/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionContext.scala:
##########
@@ -41,29 +45,68 @@ class SqlScriptingExecutionContext {
}
frames.last.exitScope(label)
}
+
+ def findHandler(condition: String, sqlState: String):
Option[ErrorHandlerExec] = {
+ if (frames.isEmpty) {
+ throw SparkException.internalError(s"Cannot find handler: no frames.")
+ }
+
+ // If the last frame is a handler, try to find a handler in its body first.
Review Comment:
Yes, by standard it is possible so we have to cover that also. Based on the
common usage patterns this is not something users usually do, but following the
standard it can be done.
--
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]