miland-db commented on code in PR #49427:
URL: https://github.com/apache/spark/pull/49427#discussion_r1916356924
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -159,15 +159,97 @@ class AstBuilder extends DataTypeAstBuilder
script
}
+ private def assertSqlState(sqlState: String): Unit = {
+ val sqlStateRegex = "^[A-Za-z0-9]{5}$".r
+ assert(sqlStateRegex.findFirstIn(sqlState).isDefined,
+ "SQLSTATE must be exactly 5 characters long and contain only A-Z and
0-9.")
+ assert(!sqlState.startsWith("00") && !sqlState.startsWith("01") &&
!sqlState.startsWith("XX"),
+ "SQLSTATE must not start with '00', '01', or 'XX'.")
Review Comment:
I agree, it will be changed to proper exception.
--
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]