SEPURI-SAI-KRISHNA commented on code in PR #60134:
URL: https://github.com/apache/spark/pull/60134#discussion_r4651823158
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -3039,6 +3047,16 @@ private[sql] object QueryExecutionErrors extends
QueryErrorsBase with ExecutionE
summary = "")
}
+ def subtractDatesOverflowError(endDay: Int, startDay: Int):
ArithmeticException = {
Review Comment:
Done. `DateDiff` and `SubtractDates` now pass their query context to the
error, in both eval and codegen. `SubtractDates` has no context under
`spark.sql.legacy.interval.enabled`, where it can't overflow.
They use the same `DateArithmeticQueryContext` trait as #59135, so the empty
context from the ANSI-off `Subtract` isn't copied over. The new test in
`DateFunctionsSuite` checks `datediff` and `e - s` in SQL and `datediff` in the
DataFrame API, with ANSI on and off. The golden files show the context too.
--
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]