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
[SPARK-36291][SQL] Refactor second set of 20 in QueryExecutionErrors to use error classes #33839
[SPARK-36291][SQL] Refactor second set of 20 in QueryExecutionErrors to use error classes #33839
Conversation
Can one of the admins verify this patch? |
cc @karenfeng FYI |
"UNABLE_TO_ACQUIRE_MEMORY" : { | ||
"message" : [ "Unable to acquire %s bytes of memory, got %s" ] | ||
}, | ||
"UNEXPECTED_DATATYPE" : { |
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.
Could we try to merge them?
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.
can we merge them like
"UNEXPECTED" : {
"message" : [ "Unexpected %s" ],
"sqlState" : "22000"
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.
I think it makes sense to just keep one or the other; maybe UNEXPECTED_TYPE
?
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.
I also think 42000 may be a better fit.
There is no suitable SQLSTATE for all error class added newly ? |
No I haven't working on adding sqlstate, I will add them soon |
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.
Thanks for working on this @dgd-contributor! I left some comments.
"UNABLE_TO_ACQUIRE_MEMORY" : { | ||
"message" : [ "Unable to acquire %s bytes of memory, got %s" ] | ||
}, | ||
"UNEXPECTED_DATATYPE" : { |
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.
I think it makes sense to just keep one or the other; maybe UNEXPECTED_TYPE
?
"UNABLE_TO_ACQUIRE_MEMORY" : { | ||
"message" : [ "Unable to acquire %s bytes of memory, got %s" ] | ||
}, | ||
"UNEXPECTED_DATATYPE" : { |
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.
I also think 42000 may be a better fit.
bfb37b8
to
f0da69d
Compare
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.
Thanks for working on this @dgd-contributor! I left some comments, please tag me when you address them.
@@ -14,13 +21,20 @@ | |||
"message" : [ "Found duplicate keys '%s'" ], | |||
"sqlState" : "23000" | |||
}, | |||
"EXCEED_ARRAY_SIZE_WHEN_ZIP_MAP" : { |
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.
This doesn't make much sense grammatically. How about ZIPPED_MAPS_EXCEED_SIZE_LIMIT
?
@@ -46,6 +68,10 @@ | |||
"message" : [ "Index %s must be between 0 and the length of the ArrayData." ], | |||
"sqlState" : "22023" | |||
}, | |||
"INTEGRAL_DIVIDE_OVERFLOW" : { | |||
"message" : [ "Overflow in integral divide." ], | |||
"sqlState" : "22015" |
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.
I think 22003
is a better fit here.
}, | ||
"GROUP_INDEX_LESS_THAN_ZERO" : { | ||
"message" : [ "The specified group index cannot be less than zero" ], | ||
"sqlState" : "07009" |
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.
I think 42000 is a better fit here as well.
"FAILED_RENAME_PATH" : { | ||
"message" : [ "Failed to rename %s to %s as destination already exists" ], | ||
"sqlState" : "22023" | ||
}, | ||
"FAILED_SET_ORIGINAL_PERMISSION_BACK" : { | ||
"message" : [ "Failed to set original permission %s back to the created path: %s. Exception: %s" ] | ||
}, | ||
"FOUND_NEGATIVE_VALUES" : { |
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.
I think UNEXPECTED_NEGATIVE_VALUES
is a better descriptor.
"CONCURRENT_QUERY" : { | ||
"message" : [ "Another instance of this query was just started by a concurrent session." ] | ||
}, | ||
"COPY_NULL_FIELD" : { |
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.
I think COPY_NULL_FIELD_NOT_ALLOWED
is a better descriptor.
@@ -77,6 +111,14 @@ | |||
"message" : [ "PARTITION clause cannot contain a non-partition column name: %s" ], | |||
"sqlState" : "42000" | |||
}, | |||
"NOT_MATCH_FUNCTION_NAME" : { | |||
"message" : [ "%s is not matched at addNewFunction" ], | |||
"sqlState" : "42000" |
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.
This is an internal error, let's remove the SQLSTATE.
@@ -77,6 +111,14 @@ | |||
"message" : [ "PARTITION clause cannot contain a non-partition column name: %s" ], | |||
"sqlState" : "42000" | |||
}, | |||
"NOT_MATCH_FUNCTION_NAME" : { |
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.
This doesn't make much sense grammatically. How about ADD_NEW_FUNCTION_NAME_MISMATCHED
?
"UNSUPPORTED_LITERAL_TYPE" : { | ||
"message" : [ "Unsupported literal type %s %s" ], | ||
"sqlState" : "0A000" | ||
}, | ||
"UNSUPPORTED_ORDERED_OPERATIONS" : { |
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.
This should be more specific, like ORDERED_OPERATIONS_UNSUPPORTED_BY_DATA_TYPE
"UNRECOGNIZED_SQL_TYPE" : { | ||
"message" : [ "Unrecognized SQL type %s" ], | ||
"sqlState" : "42000" | ||
}, | ||
"UNSUPPORTED_DATATYPE" : { |
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.
Nit: DATATYPE
-> DATA_TYPE
.
…o use error classes
f0da69d
to
4ce22c0
Compare
@karenfeng Can you re-review, I've resolve conflict and what you suggested |
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.
LGTM overall - I only have one small typo nit. @HyukjinKwon, can you take a pass once that's addressed?
@@ -60,6 +70,14 @@ | |||
"GROUPING_SIZE_LIMIT_EXCEEDED" : { | |||
"message" : [ "Grouping sets size cannot be greater than %s" ] | |||
}, | |||
"GROUP_INDEX_EXCEED_GROUP_COUNT" : { |
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.
Nit: EXCEED -> EXCEEDS
} | ||
|
||
def invalidFractionOfSecondError(): DateTimeException = { | ||
new SparkDateTimeException(errorClass = "INVALID_FRACTION_OF_SECOND", Array.empty) |
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.
Why was this changed?
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.
sorry, just a clean up
@dgd-contributor, BTW, I think we shouldn't use one account shared to many people because:
I sent an email to the address in your GitHub profile but I haven't got a reply yet. Would you mind contacting me via gurwls223@apache.org? |
@dgd-contributor, please contact me or private@spark.apache.org. As I shared in the email, the submissions from the specific shared account will not be accepted for now. |
Could you please check mail from ncthanh.work@gmail.com? Sorry for the inconvenience because the email from your side has been blocked by our mail system. |
We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
What changes were proposed in this pull request?
Refactor some exceptions in QueryExecutionErrors to use error classes.
Why are the changes needed?
There are currently ~350 exceptions in this file; so this PR only focuses on the second set of 20.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Existed UT Testcase