MaxGekk commented on code in PR #41346:
URL: https://github.com/apache/spark/pull/41346#discussion_r1208525966
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -2877,14 +2877,18 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
def invalidBoundaryStartError(start: Long): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1301",
- messageParameters = Map("start" -> start.toString))
+ errorClass = "INVALID_BOUNDARY",
+ messageParameters = Map(
+ "boundary" -> "start",
Review Comment:
Could you quote it as an id using `toSQLId`
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -904,6 +904,11 @@
],
"sqlState" : "22003"
},
+ "INVALID_BOUNDARY" : {
+ "message" : [
+ "Boundary <boundary> is not a valid integer: <value>."
Review Comment:
Precisely, speaking:
- `start` can be 0, Long.MinValue, or [Int.MinValue, Int.MaxValue]
- `stop` - 0, Long.MaxValue, or [Int.MinValue, Int.MaxValue]
Could you, please, add sub-classes like:
```
"INVALID_BOUNDARY" : {
"message" : [
"The boundary <boundary> is invalid: <invalidValue>."
...
"subClass" : {
"START" : {
"message" : [
"Expected ... ."
]
},
```
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -2877,14 +2877,18 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
def invalidBoundaryStartError(start: Long): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1301",
- messageParameters = Map("start" -> start.toString))
+ errorClass = "INVALID_BOUNDARY",
+ messageParameters = Map(
+ "boundary" -> "start",
+ "value" -> toSQLValue(start, LongType)))
}
def invalidBoundaryEndError(end: Long): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1302",
- messageParameters = Map("end" -> end.toString))
+ errorClass = "INVALID_BOUNDARY",
+ messageParameters = Map(
+ "boundary" -> "end",
Review Comment:
Wrap it by `toSQLId()`, please.
--
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]