MaxGekk commented on code in PR #47846:
URL: https://github.com/apache/spark/pull/47846#discussion_r1734695166
##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -1914,6 +1914,29 @@
],
"sqlState" : "22012"
},
+ "INTERVAL_ERROR" : {
+ "message" : [
+ "Interval error."
+ ],
+ "subClass" : {
+ "ILLEGAL_DAY_OF_WEEK" : {
+ "message" : [
+ "Illegal input for day of week: <string>."
+ ]
+ },
+ "INTERVAL_PARSING" : {
+ "message" : [
+ "Error parsing interval <interval> string: <msg>."
+ ]
+ },
+ "SECOND_NANO_FORMAT" : {
Review Comment:
Shouldn't this be a sub-class of `INVALID_INTERVAL_FORMAT`?
##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -1914,6 +1914,29 @@
],
"sqlState" : "22012"
},
+ "INTERVAL_ERROR" : {
Review Comment:
Let's name it as `INVALID_INTERVAL`
##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -1914,6 +1914,29 @@
],
"sqlState" : "22012"
},
+ "INTERVAL_ERROR" : {
+ "message" : [
+ "Interval error."
+ ],
+ "subClass" : {
+ "ILLEGAL_DAY_OF_WEEK" : {
+ "message" : [
+ "Illegal input for day of week: <string>."
+ ]
+ },
+ "INTERVAL_PARSING" : {
+ "message" : [
+ "Error parsing interval <interval> string: <msg>."
Review Comment:
Let's don't include arbitrary message from `cause`. Just assign it to the
`cause` field.
##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -1914,6 +1914,29 @@
],
"sqlState" : "22012"
},
+ "INTERVAL_ERROR" : {
+ "message" : [
+ "Interval error."
Review Comment:
Provide the invalid interval here.
##########
sql/core/src/test/resources/sql-tests/results/ansi/date.sql.out:
##########
@@ -268,7 +268,8 @@ struct<>
-- !query output
org.apache.spark.SparkIllegalArgumentException
{
- "errorClass" : "_LEGACY_ERROR_TEMP_3209",
+ "errorClass" : "INTERVAL_ERROR.ILLEGAL_DAY_OF_WEEK",
Review Comment:
Could you explain how this error related to the type `INTERVAL`? Let's move
`ILLEGAL_DAY_OF_WEEK` out of `INTERVAL_ERROR`.
--
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]