yaooqinn 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_r347734510
##########
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:
```sql
presto> select interval '1.' second;
_col0
----------------
0 00:00:01.000
(1 row)
Query 20191119_051438_00001_f5kcs, FINISHED, 1 node
Splits: 17 total, 17 done (100.00%)
0:03 [0 rows, 0B] [0 rows/s, 0B/s]
presto> select interval '.' second;
Query 20191119_051452_00002_f5kcs failed: Invalid INTERVAL SECOND value: .
```
Also check with presto, '1.' seconds is valid
----------------------------------------------------------------
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]