gengliangwang commented on code in PR #46210:
URL: https://github.com/apache/spark/pull/46210#discussion_r1619255422
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala:
##########
@@ -698,7 +698,7 @@ object DateTimeUtils extends SparkDateTimeUtils {
}
} catch {
case _: scala.MatchError =>
- throw SparkException.internalError(s"Got the unexpected unit '$unit'.")
+ throw QueryExecutionErrors.invalidDatetimeUnitError("timestampAdd",
unit)
Review Comment:
nit: TIMESTAMPADD
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala:
##########
@@ -736,7 +736,7 @@ object DateTimeUtils extends SparkDateTimeUtils {
val endLocalTs = getLocalDateTime(endTs, zoneId)
timestampDiffMap(unitInUpperCase)(startLocalTs, endLocalTs)
} else {
- throw SparkException.internalError(s"Got the unexpected unit '$unit'.")
+ throw QueryExecutionErrors.invalidDatetimeUnitError("timestampDiff",
unit)
Review Comment:
nit: TIMESTAMPDIFF
--
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]