miland-db commented on code in PR #49726:
URL: https://github.com/apache/spark/pull/49726#discussion_r1951029322
##########
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("'", "")))
Review Comment:
By looking at the rest of the code I think
`string(visitStringLit(ctx.someStringLiteral))` is the way to go. This way, we
don't need to replace quotes because they are visited inside this method and
string value is returned.
@cloud-fan, can you please share your thoughts if this is the "correct" way
to parse string literals?
--
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]