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


##########
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,
+      message = messageVariable.getOrElse(messageString.getOrElse(Left(""))),
+      messageArguments = messageArguments
+    )
+  }
+
+  override def visitSignalStatementWithSqlState(
+      ctx: SignalStatementWithSqlStateContext): SignalStatement = {
+    val sqlState = visitStringLit(ctx.sqlState).getText.replace("'", "")

Review Comment:
   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: 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

Reply via email to