MaxGekk commented on code in PR #38954:
URL: https://github.com/apache/spark/pull/38954#discussion_r1044416555


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryParsingErrors.scala:
##########
@@ -211,7 +211,7 @@ private[sql] object QueryParsingErrors extends 
QueryErrorsBase {
   def cannotParseValueTypeError(
       valueType: String, value: String, ctx: TypeConstructorContext): 
Throwable = {
     new ParseException(
-      errorClass = "_LEGACY_ERROR_TEMP_0019",
+      errorClass = "CANNOT_PARSE_VALUE_TO_DATATYPE",
       messageParameters = Map("valueType" -> valueType, "value" -> value),

Review Comment:
   Please, quote `value` as a string using `toSQLValue()`, and `valueType` by 
default (can use `toSQLType()`).



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -80,6 +80,12 @@
     ],
     "sqlState" : "42000"
   },
+  "CANNOT_PARSE_VALUE_TO_DATATYPE" : {

Review Comment:
   Let's make it shorter: `INVALID_TYPED_LITERAL` taking into account that 
there is `UNSUPPORTED_TYPED_LITERAL` already.



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -80,6 +80,12 @@
     ],
     "sqlState" : "42000"
   },
+  "CANNOT_PARSE_VALUE_TO_DATATYPE" : {
+    "message" : [
+      "Cannot parse <value> to <valueType> type."

Review Comment:
   `The value of the typed literal <valueType> is invalid: <value>.`
   
   If `valueType` is `X`, the message might confuse since there is no type `X`.



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