You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/03/25 11:18:03 UTC

[GitHub] [spark] res-life commented on a change in pull request #35845: [SPARK-38520][SQL] ANSI interval overflow when reading CSV

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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org