karenfeng commented on a change in pull request #33538:
URL: https://github.com/apache/spark/pull/33538#discussion_r710477451
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -3,6 +3,34 @@
"message" : [ "Field name %s is ambiguous and has %s matching fields in
the struct." ],
"sqlState" : "42000"
},
+ "CANNOT_CAST_DATATYPE" : {
+ "message" : [ "Cannot cast %s to %s." ],
+ "sqlState" : "22018"
Review comment:
I think `22005` may be a better fit.
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -54,9 +88,19 @@
"message" : [ "The fraction of sec must be zero. Valid range is [0, 60]."
],
"sqlState" : "22023"
},
+ "INVALID_INPUT_SYNTAX_FOR_NUMERIC" : {
+ "message" : [ "invalid input syntax for type numeric: %s" ],
+ "sqlState" : "42000"
+ },
"INVALID_JSON_SCHEMA_MAPTYPE" : {
"message" : [ "Input schema %s can only contain StringType as a key type
for a MapType." ]
},
+ "LOGICAL_HINT_OPERATOR_NOT_REMOVE_DURING_ANALYSIS" : {
Review comment:
`LOGICAL_HINT_OPERATOR_NOT_REMOVE_DURING_ANALYSIS` ->
`LOGICAL_HINT_OPERATOR_NOT_REMOVED_DURING_ANALYSIS`
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -3,6 +3,34 @@
"message" : [ "Field name %s is ambiguous and has %s matching fields in
the struct." ],
"sqlState" : "42000"
},
+ "CANNOT_CAST_DATATYPE" : {
+ "message" : [ "Cannot cast %s to %s." ],
+ "sqlState" : "22018"
+ },
+ "CANNOT_CHANGE_DECIMAL_PRECISION" : {
+ "message" : [ "%s cannot be represented as Decimal(%s, %s)." ],
+ "sqlState" : "22023"
+ },
+ "CANNOT_EVALUATE_EXPRESSION" : {
+ "message" : [ "Cannot evaluate expression: %s: %s" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_GENERATE_CODE_FOR_EXPRESSION" : {
+ "message" : [ "Cannot generate code for expression: %s" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_PARSE_DECIMAL" : {
+ "message" : [ "Cannot parse any decimal" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_TERMINATE_GENERATOR" : {
+ "message" : [ "Cannot terminate expression: %s" ],
+ "sqlState" : "42000"
Review comment:
I'm not sure this has an obvious SQLSTATE.
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -3,6 +3,34 @@
"message" : [ "Field name %s is ambiguous and has %s matching fields in
the struct." ],
"sqlState" : "42000"
},
+ "CANNOT_CAST_DATATYPE" : {
+ "message" : [ "Cannot cast %s to %s." ],
+ "sqlState" : "22018"
+ },
+ "CANNOT_CHANGE_DECIMAL_PRECISION" : {
+ "message" : [ "%s cannot be represented as Decimal(%s, %s)." ],
+ "sqlState" : "22023"
+ },
+ "CANNOT_EVALUATE_EXPRESSION" : {
+ "message" : [ "Cannot evaluate expression: %s: %s" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_GENERATE_CODE_FOR_EXPRESSION" : {
+ "message" : [ "Cannot generate code for expression: %s" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_PARSE_DECIMAL" : {
+ "message" : [ "Cannot parse any decimal" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_TERMINATE_GENERATOR" : {
+ "message" : [ "Cannot terminate expression: %s" ],
+ "sqlState" : "42000"
+ },
+ "CAST_CAUSE_OVERFLOW" : {
+ "message" : [ "Casting %s to %s causes overflow" ],
+ "sqlState" : "22018"
Review comment:
I think `22005` is a better fit here.
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -96,10 +144,21 @@
"message" : [ "Unrecognized SQL type %s" ],
"sqlState" : "42000"
},
+ "UNSUPPORTED_CHANGE_COLUMN" : {
+ "message" : [ "Please add an implementation for a column change here" ],
+ "sqlState" : "0A000"
+ },
+ "UNSUPPORTED_DATATYPE" : {
+ "message" : [ "Unsupported data type %s %s" ],
Review comment:
This is a little awkward in the case that there is no value for the
first param; as discussed above, I think we should combine the two-param case
into one string param.
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -3,6 +3,34 @@
"message" : [ "Field name %s is ambiguous and has %s matching fields in
the struct." ],
"sqlState" : "42000"
},
+ "CANNOT_CAST_DATATYPE" : {
+ "message" : [ "Cannot cast %s to %s." ],
+ "sqlState" : "22018"
+ },
+ "CANNOT_CHANGE_DECIMAL_PRECISION" : {
+ "message" : [ "%s cannot be represented as Decimal(%s, %s)." ],
+ "sqlState" : "22023"
+ },
+ "CANNOT_EVALUATE_EXPRESSION" : {
+ "message" : [ "Cannot evaluate expression: %s: %s" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_GENERATE_CODE_FOR_EXPRESSION" : {
+ "message" : [ "Cannot generate code for expression: %s" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_PARSE_DECIMAL" : {
+ "message" : [ "Cannot parse any decimal" ],
Review comment:
This is a strange message. Can we change this to `Cannot parse decimal`?
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -3,6 +3,34 @@
"message" : [ "Field name %s is ambiguous and has %s matching fields in
the struct." ],
"sqlState" : "42000"
},
+ "CANNOT_CAST_DATATYPE" : {
+ "message" : [ "Cannot cast %s to %s." ],
+ "sqlState" : "22018"
+ },
+ "CANNOT_CHANGE_DECIMAL_PRECISION" : {
+ "message" : [ "%s cannot be represented as Decimal(%s, %s)." ],
+ "sqlState" : "22023"
+ },
+ "CANNOT_EVALUATE_EXPRESSION" : {
+ "message" : [ "Cannot evaluate expression: %s: %s" ],
Review comment:
This is a little awkward in the case that there is no value for the
first param (it would look like `Cannot evaluate expression: : expression`).
I think we should just have it be: `Cannot evaluate expression: %s` and pass
`methodName: unEvaluable.toString` as the single param.
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -3,6 +3,34 @@
"message" : [ "Field name %s is ambiguous and has %s matching fields in
the struct." ],
"sqlState" : "42000"
},
+ "CANNOT_CAST_DATATYPE" : {
+ "message" : [ "Cannot cast %s to %s." ],
+ "sqlState" : "22018"
+ },
+ "CANNOT_CHANGE_DECIMAL_PRECISION" : {
+ "message" : [ "%s cannot be represented as Decimal(%s, %s)." ],
+ "sqlState" : "22023"
Review comment:
I think `22005` may be a better fit here as well.
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -3,6 +3,34 @@
"message" : [ "Field name %s is ambiguous and has %s matching fields in
the struct." ],
"sqlState" : "42000"
},
+ "CANNOT_CAST_DATATYPE" : {
+ "message" : [ "Cannot cast %s to %s." ],
+ "sqlState" : "22018"
+ },
+ "CANNOT_CHANGE_DECIMAL_PRECISION" : {
+ "message" : [ "%s cannot be represented as Decimal(%s, %s)." ],
+ "sqlState" : "22023"
+ },
+ "CANNOT_EVALUATE_EXPRESSION" : {
+ "message" : [ "Cannot evaluate expression: %s: %s" ],
+ "sqlState" : "42000"
Review comment:
This is likely an internal error; I think we can remove the SQLSTATE
here.
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -96,10 +144,21 @@
"message" : [ "Unrecognized SQL type %s" ],
"sqlState" : "42000"
},
+ "UNSUPPORTED_CHANGE_COLUMN" : {
+ "message" : [ "Please add an implementation for a column change here" ],
+ "sqlState" : "0A000"
+ },
+ "UNSUPPORTED_DATATYPE" : {
+ "message" : [ "Unsupported data type %s %s" ],
+ "sqlState" : "0A000"
+ },
"UNSUPPORTED_LITERAL_TYPE" : {
"message" : [ "Unsupported literal type %s %s" ],
"sqlState" : "0A000"
},
+ "UNSUPPORTED_SIMPLE_STRING_WITH_NODEID" : {
Review comment:
Nit: `UNSUPPORTED_SIMPLE_STRING_WITH_NODEID` ->
`UNSUPPORTED_SIMPLE_STRING_WITH_NODE_ID`
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -54,9 +88,19 @@
"message" : [ "The fraction of sec must be zero. Valid range is [0, 60]."
],
"sqlState" : "22023"
},
+ "INVALID_INPUT_SYNTAX_FOR_NUMERIC" : {
+ "message" : [ "invalid input syntax for type numeric: %s" ],
+ "sqlState" : "42000"
+ },
"INVALID_JSON_SCHEMA_MAPTYPE" : {
"message" : [ "Input schema %s can only contain StringType as a key type
for a MapType." ]
},
+ "LOGICAL_HINT_OPERATOR_NOT_REMOVE_DURING_ANALYSIS" : {
+ "message" : [ "Internal error: logical hint operator should have been
removed during analysis" ]
+ },
+ "MAP_KEY_NOT_EXIST" : {
Review comment:
The grammar here is a bit clumsy. Can we make this
`MAP_KEY_DOES_NOT_EXIST`?
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -54,9 +88,19 @@
"message" : [ "The fraction of sec must be zero. Valid range is [0, 60]."
],
"sqlState" : "22023"
},
+ "INVALID_INPUT_SYNTAX_FOR_NUMERIC" : {
Review comment:
Nit: `INVALID_INPUT_SYNTAX_FOR_NUMERIC` ->
`INVALID_INPUT_SYNTAX_FOR_NUMERIC_TYPE`
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -3,6 +3,34 @@
"message" : [ "Field name %s is ambiguous and has %s matching fields in
the struct." ],
"sqlState" : "42000"
},
+ "CANNOT_CAST_DATATYPE" : {
+ "message" : [ "Cannot cast %s to %s." ],
+ "sqlState" : "22018"
+ },
+ "CANNOT_CHANGE_DECIMAL_PRECISION" : {
+ "message" : [ "%s cannot be represented as Decimal(%s, %s)." ],
+ "sqlState" : "22023"
+ },
+ "CANNOT_EVALUATE_EXPRESSION" : {
+ "message" : [ "Cannot evaluate expression: %s: %s" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_GENERATE_CODE_FOR_EXPRESSION" : {
+ "message" : [ "Cannot generate code for expression: %s" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_PARSE_DECIMAL" : {
+ "message" : [ "Cannot parse any decimal" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_TERMINATE_GENERATOR" : {
+ "message" : [ "Cannot terminate expression: %s" ],
+ "sqlState" : "42000"
+ },
+ "CAST_CAUSE_OVERFLOW" : {
Review comment:
Nit: `CAST_CAUSE_OVERFLOW` -> `CAST_CAUSES_OVERFLOW`
##########
File path: core/src/main/resources/error/error-classes.json
##########
@@ -3,6 +3,34 @@
"message" : [ "Field name %s is ambiguous and has %s matching fields in
the struct." ],
"sqlState" : "42000"
},
+ "CANNOT_CAST_DATATYPE" : {
+ "message" : [ "Cannot cast %s to %s." ],
+ "sqlState" : "22018"
+ },
+ "CANNOT_CHANGE_DECIMAL_PRECISION" : {
+ "message" : [ "%s cannot be represented as Decimal(%s, %s)." ],
+ "sqlState" : "22023"
+ },
+ "CANNOT_EVALUATE_EXPRESSION" : {
+ "message" : [ "Cannot evaluate expression: %s: %s" ],
+ "sqlState" : "42000"
+ },
+ "CANNOT_GENERATE_CODE_FOR_EXPRESSION" : {
+ "message" : [ "Cannot generate code for expression: %s" ],
+ "sqlState" : "42000"
Review comment:
I'm not sure this has an obvious SQLSTATE.
--
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]