itholic commented on code in PR #40641:
URL: https://github.com/apache/spark/pull/40641#discussion_r1155813814
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -542,6 +542,12 @@
],
"sqlState" : "22003"
},
+ "ARRAY_INSERT_BY_INDEX_ZERO" : {
+ "message" : [
+ "The index 0 is invalid. An index shall be either < 0 or > 0 (the first
element has index 1)."
+ ],
+ "sqlState" : "22003"
Review Comment:
Yes, if a particular SQL state is appropriate for representing a specific
error, we can use the same SQL state in multiple error classes.
But on my second thought, maybe can we consolidate
`ELEMENT_AT_BY_INDEX_ZERO` and `ARRAY_INSERT_BY_INDEX_ZERO` into single error
class if they have exactly the same error message??
For example:
```
"ZERO_INDEX_ERROR" : {
"message" : [
"The index 0 is invalid. An index shall be either < 0 or > 0 (the
first element has index 1)."
],
"sqlState" : "22003"
},
```
I'm not 100% sure if `ZERO_INDEX_ERROR` is proper to cover the both cases.
WDYT @srielau @MaxGekk ?
--
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]