miland-db commented on code in PR #49726: URL: https://github.com/apache/spark/pull/49726#discussion_r1954155098
########## sql/core/src/main/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionNode.scala: ########## @@ -1020,3 +1024,107 @@ class ExceptionHandlerExec( override def reset(): Unit = body.reset() } + +/** + * Executable node for Signal Statement. + * @param errorCondition Name of the error condition/SQL State for error that will be thrown. + * @param sqlState SQL State of the error that will be thrown. + * @param message Error message (either string or variable name). + * @param isBuiltinError Whether the error condition is a builtin condition. + * @param msgArguments Error message parameters for builtin conditions. + * @param session Spark session that SQL script is executed within. + * @param origin Origin descriptor for the statement. + */ +class SignalStatementExec( + val errorCondition: String, + val sqlState: String, + val message: Either[String, UnresolvedAttribute], Review Comment: There is no requirement, but for scripting specific statements we usually don't go through Analyzer because we are able to "resolve and execute" them inside scripting engine. In this case, `SignalStatementExec` just keeps information about the exception that needs to be thrown. When we encounter it during script execution, we just read necessary information and throw an exception. Example we used was code for `EXECUTE IMMEDIATE` and how is `query_string` resolved there. -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org