panbingkun commented on code in PR #41214:
URL: https://github.com/apache/spark/pull/41214#discussion_r1198690104


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala:
##########
@@ -407,8 +407,8 @@ private[sql] object QueryParsingErrors extends 
QueryErrorsBase {
 
   def computeStatisticsNotExpectedError(ctx: IdentifierContext): Throwable = {
     new ParseException(
-      errorClass = "_LEGACY_ERROR_TEMP_0036",
-      messageParameters = Map("ctx" -> ctx.getText),
+      errorClass = "INVALID_SQL_SYNTAX",
+      messageParameters = Map("inputString" -> s"${ctx.getText} must be 
${toSQLStmt("NOSCAN")}"),

Review Comment:
   I have found many similar uses in `QueryParsingErrors`. Should we refactor 
it to classify `INVALID_SQL_SYNTAX ` and avoid to embed error's text in source 
code?
   eg: 
https://github.com/apache/spark/blob/df7e2d07f04c7e16af04c1292227a90516083de1/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala#L74-L80
   
   Because I think it is not good to assign a new name for the above scenario, 
because it is a syntax error.



-- 
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]

Reply via email to