cloud-fan commented on a change in pull request #26573: [SPARK-29926][SQL] Fix 
weird interval string whose value end with a dangling decimal point
URL: https://github.com/apache/spark/pull/26573#discussion_r347751820
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/IntervalUtilsSuite.scala
 ##########
 @@ -115,12 +115,12 @@ class IntervalUtilsSuite extends SparkFunSuite {
     checkFromInvalidString("2234567890 days", "integer overflow")
     checkFromInvalidString("\n", "Error parsing '\n' to interval")
     checkFromInvalidString("\t", "Error parsing '\t' to interval")
-
+    checkFromInvalidString("1. seconds", "invalid value '1.'")
+    checkFromInvalidString(". seconds", "invalid value '.'")
   }
 
   test("string to interval: seconds with fractional part") {
     checkFromString("0.1 seconds", new CalendarInterval(0, 0, 100000))
-    checkFromString("1. seconds", new CalendarInterval(0, 0, 1000000))
 
 Review comment:
   @HyukjinKwon good point. To be consistent with Spark's own parser, maybe we 
should allow `interval '1.' second`. But `interval '.' second` should be 
invalid.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to