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 2021/04/22 05:55:59 UTC

[GitHub] [spark] MaxGekk commented on a change in pull request #32281: [SPARK-35177][SQL] Fix arithmetic overflow in parsing the minimal interval by `IntervalUtils.fromYearMonthString`

MaxGekk commented on a change in pull request #32281:
URL: https://github.com/apache/spark/pull/32281#discussion_r618099976



##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/IntervalUtilsSuite.scala
##########
@@ -169,6 +169,19 @@ class IntervalUtilsSuite extends SparkFunSuite with SQLHelper {
       fromYearMonthString)
     failFuncWithInvalidInput("-\t99-15", "Interval string does not match year-month format",
       fromYearMonthString)
+
+    assert(fromYearMonthString("178956970-6") == new CalendarInterval(2147483646, 0, 0))

Review comment:
       nit: let's use `Int.MaxValue - 1`




-- 
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.

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