MaxGekk commented on code in PR #38273:
URL: https://github.com/apache/spark/pull/38273#discussion_r998048906
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -551,6 +561,11 @@
],
"sqlState" : "22005"
},
+ "OUT_OF_DECIMAL_TYPE_RANGE" : {
+ "message" : [
+ "out of decimal type range: <value>"
Review Comment:
nit: Please, upper case the first letter to be consistent w/ other error
messages.
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -686,6 +701,11 @@
},
"sqlState" : "42000"
},
+ "UNSCALED_VALUE_TOO_LARGE_FOR_PRECISION" : {
+ "message" : [
+ "Unscaled value too large for precision. If necessary set <ANSIEnabled>
to false to bypass this error."
Review Comment:
ANSIEnabled -> ansiConfig, see other error classes.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -2307,8 +2310,14 @@ private[sql] object QueryExecutionErrors extends
QueryErrorsBase {
new SparkException("Foreach writer has been aborted due to a task failure")
}
- def integerOverflowError(message: String): Throwable = {
- new ArithmeticException(s"Integer overflow. $message")
+ def integerOverflowError(message: String): SparkArithmeticException = {
Review Comment:
The method `integerOverflowError` is invoked from only 2 places. Let's
introduce specific error classes for both cases, and don't pass arbitrary
message.
Could you image that we will output errors according to locale in a local
language. In that case, we will translate entire `error-classes.json` to the
language but some text will pass in English from source code. That looks
inconsistent.
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -396,6 +401,11 @@
}
}
},
+ "INTEGER_OVERFLOW" : {
Review Comment:
What's the difference with `ARITHMETIC_OVERFLOW`? Can't you re-use the last
one?
--
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]