-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-36107][SQL] Refactor first set of 20 query execution errors to use error classes #33538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
9025b97
14ec185
0546f96
6bfb10c
13dfe5b
5a8e5f9
32d2e6f
1f979c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| }, | ||
| "CANNOT_CHANGE_DECIMAL_PRECISION" : { | ||
| "message" : [ "%s cannot be represented as Decimal(%s, %s)." ], | ||
| "sqlState" : "22023" | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| }, | ||
| "CANNOT_EVALUATE_EXPRESSION" : { | ||
| "message" : [ "Cannot evaluate expression: %s: %s" ], | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| "sqlState" : "42000" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is likely an internal error; I think we can remove the SQLSTATE here. |
||
| }, | ||
| "CANNOT_GENERATE_CODE_FOR_EXPRESSION" : { | ||
| "message" : [ "Cannot generate code for expression: %s" ], | ||
| "sqlState" : "42000" | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| }, | ||
| "CANNOT_PARSE_DECIMAL" : { | ||
| "message" : [ "Cannot parse any decimal" ], | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| "sqlState" : "42000" | ||
| }, | ||
| "CANNOT_TERMINATE_GENERATOR" : { | ||
| "message" : [ "Cannot terminate expression: %s" ], | ||
| "sqlState" : "42000" | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| }, | ||
| "CAST_CAUSE_OVERFLOW" : { | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| "message" : [ "Casting %s to %s causes overflow" ], | ||
| "sqlState" : "22018" | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| }, | ||
| "CONCURRENT_QUERY_ERROR" : { | ||
| "message" : [ "Another instance of this query was just started by a concurrent session." ] | ||
| }, | ||
|
|
@@ -14,6 +42,10 @@ | |
| "message" : [ "Found duplicate keys '%s'" ], | ||
| "sqlState" : "23000" | ||
| }, | ||
| "FAILED_EXECUTE_UDF" : { | ||
| "message" : [ "Failed to execute user defined function (%s: (%s) => %s)" ], | ||
| "sqlState" : "45000" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The SQLSTATE '45000' is not valid. Because it is not included in README
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @karenfeng I delete it. |
||
| }, | ||
| "FAILED_RENAME_PATH" : { | ||
| "message" : [ "Failed to rename %s to %s as destination already exists" ], | ||
| "sqlState" : "22023" | ||
|
|
@@ -46,6 +78,9 @@ | |
| "message" : [ "Index %s must be between 0 and the length of the ArrayData." ], | ||
| "sqlState" : "22023" | ||
| }, | ||
| "INVALID_ARRAY_INDEX" : { | ||
| "message" : [ "Invalid index: %s, numElements: %s" ] | ||
| }, | ||
| "INVALID_FIELD_NAME" : { | ||
| "message" : [ "Field name %s is invalid: %s is not a struct." ], | ||
| "sqlState" : "42000" | ||
|
|
@@ -54,9 +89,19 @@ | |
| "message" : [ "The fraction of sec must be zero. Valid range is [0, 60]." ], | ||
| "sqlState" : "22023" | ||
| }, | ||
| "INVALID_INPUT_SYNTAX_FOR_NUMERIC" : { | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| "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" : { | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| "message" : [ "Internal error: logical hint operator should have been removed during analysis" ] | ||
| }, | ||
| "MAP_KEY_NOT_EXIST" : { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The grammar here is a bit clumsy. Can we make this |
||
| "message" : [ "Key %s does not exist." ] | ||
| }, | ||
| "MISSING_COLUMN" : { | ||
| "message" : [ "cannot resolve '%s' given input columns: [%s]" ], | ||
| "sqlState" : "42000" | ||
|
|
@@ -85,21 +130,36 @@ | |
| "message" : [ "Failed to rename as %s was not found" ], | ||
| "sqlState" : "22023" | ||
| }, | ||
| "ROW_FROM_CSV_PARSER_NOT_EXPECTED" : { | ||
| "message" : [ "Expected one row from CSV parser." ], | ||
| "sqlState" : "42000" | ||
| }, | ||
| "SECOND_FUNCTION_ARGUMENT_NOT_INTEGER" : { | ||
| "message" : [ "The second argument of '%s' function needs to be an integer." ], | ||
| "sqlState" : "22023" | ||
| }, | ||
| "UNABLE_TO_ACQUIRE_MEMORY" : { | ||
| "message" : [ "Unable to acquire %s bytes of memory, got %s" ] | ||
| }, | ||
| "UNRECOGNIZED_SQL_TYPE" : { | ||
| "message" : [ "Unrecognized SQL type %s" ], | ||
| "sqlState" : "42000" | ||
| "UNSUPPORTED_CHANGE_COLUMN" : { | ||
|
Peng-Lei marked this conversation as resolved.
Outdated
|
||
| "message" : [ "Please add an implementation for a column change here" ], | ||
| "sqlState" : "0A000" | ||
| }, | ||
| "UNSUPPORTED_DATATYPE" : { | ||
| "message" : [ "Unsupported data type %s %s" ], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
| "sqlState" : "0A000" | ||
| }, | ||
| "UNSUPPORTED_LITERAL_TYPE" : { | ||
| "message" : [ "Unsupported literal type %s %s" ], | ||
| "sqlState" : "0A000" | ||
| }, | ||
| "UNSUPPORTED_SIMPLE_STRING_WITH_NODEID" : { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: |
||
| "message" : [ "%s does not implement simpleStringWithNodeId" ] | ||
| }, | ||
| "UNRECOGNIZED_SQL_TYPE" : { | ||
| "message" : [ "Unrecognized SQL type %s" ], | ||
| "sqlState" : "42000" | ||
| }, | ||
| "UNSUPPORTED_TRANSACTION_BY_JDBC_SERVER" : { | ||
| "message" : [ "The target JDBC server does not support transaction and can only support ALTER TABLE with a single action." ], | ||
| "sqlState" : "0A000" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any ideas how to trigger this error class? I haven't found any ways how trigger it from user code. WDYT? @cloud-fan @HyukjinKwon