res-life commented on a change in pull request #35845:
URL: https://github.com/apache/spark/pull/35845#discussion_r835177932
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/IntervalUtils.scala
##########
@@ -352,13 +352,16 @@ object IntervalUtils {
val sign = finalSign(firstSign, secondSign)
unit.toUpperCase(Locale.ROOT) match {
case "DAY" if suffix == null && value.length <= 9 &&
checkTargetType(DT.DAY, DT.DAY) =>
- sign * value.toLong * MICROS_PER_DAY
+ val days = toLongWithRange(dayStr, value, 0, MAX_DAY)
+ sign * days * MICROS_PER_DAY
Review comment:
Done. But for the hours entry can't use this, because of hours range is
not [0, 23] but a large number.
--
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]