HyukjinKwon 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_r347727854
 
 

 ##########
 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:
   Will we explicitly disable this case? 
   
   ```scala
   scala> sql("select 0.")
   res0: org.apache.spark.sql.DataFrame = [0: decimal(1,0)]
   ```
   
   At least I know Python, Java, Scala and R support this way as well.

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