-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-38710][SQL] Use SparkArithmeticException for arithmetic overflow runtime errors #36022
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
Conversation
| }, | ||
| "ARITHMETIC_OVERFLOW": { | ||
| "message": ["%s.%s If necessary set %s to false (except for ANSI interval type) to bypass this error.%s"], | ||
| "sqlState": "22003" |
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.
| SQLSTATE | Class | Condition | Subclass | Subcondition |
|---|---|---|---|---|
| 22003 | 22 | data exception | 003 | numeric value out of range |
|
Merging to master/3.3 |
…ow runtime errors ### What changes were proposed in this pull request? On arithmetic overflow runtime errors, Spark should throw SparkArithmeticException instead of `java.lang.ArithmeticException` ### Why are the changes needed? Use a better error exception type. ### Does this PR introduce _any_ user-facing change? Yes, trivial change on the exception type: on arithmetic overflow runtime errors, Spark will throw SparkArithmeticException instead of `java.lang.ArithmeticException` ### How was this patch tested? UT Closes #36022 from gengliangwang/ArithmeticException. Authored-by: Gengliang Wang <[email protected]> Signed-off-by: Gengliang Wang <[email protected]> (cherry picked from commit b70fa24) Signed-off-by: Gengliang Wang <[email protected]>
|
question, I haven't kept up with all the error changes, but this only changes 1 place and there are other places in the QueryExecutionErrors that still use the ArtithmeticException, like right above the one you changed: is there a reason we are now inconsistent? |
|
@tgravescs Good point. |
|
thanks for the clarification and followup @gengliangwang |
What changes were proposed in this pull request?
On arithmetic overflow runtime errors, Spark should throw SparkArithmeticException instead of
java.lang.ArithmeticExceptionWhy are the changes needed?
Use a better error exception type.
Does this PR introduce any user-facing change?
Yes, trivial change on the exception type: on arithmetic overflow runtime errors, Spark will throw SparkArithmeticException instead of
java.lang.ArithmeticExceptionHow was this patch tested?
UT