davidm-db commented on code in PR #49726: URL: https://github.com/apache/spark/pull/49726#discussion_r1946339387
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala: ########## @@ -288,6 +288,42 @@ class AstBuilder extends DataTypeAstBuilder ExceptionHandler(exceptionHandlerTriggers, body, handlerType) } + override def visitSignalStatementWithCondition( + ctx: SignalStatementWithConditionContext): SignalStatement = { + val messageString = Option(ctx.msgStr) + .map(sl => Left(string(visitStringLit(sl)).replace("'", ""))) + val messageVariable = Option(ctx.msgVar) + .map(mpi => Right(UnresolvedAttribute(visitMultipartIdentifier(mpi)))) + val messageArguments = Option(ctx.argVar) + .map(mpi => UnresolvedAttribute(visitMultipartIdentifier(mpi))) + + SignalStatement( + errorCondition = Some(ctx.conditionName.getText.toUpperCase(Locale.ROOT)), + sqlState = None, Review Comment: Let's add a comment that explains that we set the `sqlState` to `None` here and fill it in in `visitCompoundBodyImpl` once all the conditions have been resolved. -- 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