MaxGekk commented on code in PR #48773:
URL: https://github.com/apache/spark/pull/48773#discussion_r1834996914
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -636,22 +636,26 @@ private[sql] object QueryExecutionErrors extends
QueryErrorsBase with ExecutionE
summary = "")
}
- def intervalArithmeticOverflowError(
- message: String,
- hint: String = "",
- context: QueryContext): ArithmeticException = {
- val alternative = if (hint.nonEmpty) {
- s" Use '$hint' to tolerate overflow and return NULL instead."
- } else ""
+ def withTrySuggestionIntervalArithmeticOverflowError(
+ suggestedFunc: String,
+ context: QueryContext = null): ArithmeticException = {
new SparkArithmeticException(
- errorClass = "INTERVAL_ARITHMETIC_OVERFLOW",
- messageParameters = Map(
- "message" -> message,
- "alternative" -> alternative),
+ errorClass = "INTERVAL_ARITHMETIC_OVERFLOW.WITH_TRY_SUGGESTION",
+ messageParameters = Map("functionName" -> suggestedFunc),
Review Comment:
the sugggested function name is an identifier, so, let's quote it by
`toSQLId`:
```suggestion
messageParameters = Map("functionName" -> toSQLId(suggestedFunc)),
```
--
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]