dongjoon-hyun commented on a change in pull request #25097: [SPARK-28015][SQL]
Check stringToDate() consumes entire input for the yyyy and yyyy-[m]m formats
URL: https://github.com/apache/spark/pull/25097#discussion_r302180361
##########
File path: sql/core/src/test/resources/sql-tests/results/pgSQL/date.sql.out
##########
@@ -198,17 +198,29 @@ struct<DATE '1999-01-18':date>
-- !query 21
SELECT date '1999 Jan 08'
-- !query 21 schema
-struct<DATE '1999-01-01':date>
+struct<>
-- !query 21 output
-1999-01-01
+org.apache.spark.sql.catalyst.parser.ParseException
+
+Cannot parse the DATE value: 1999 Jan 08(line 1, pos 7)
+
+== SQL ==
+SELECT date '1999 Jan 08'
Review comment:
Note that this is only for `date` prefix. With this PR, we will return
`NULL` like Hive.
```
spark-sql> SELECT CAST('1999 08 01' AS DATE);
NULL
```
@MaxGekk . Could you mention these two cases together in the PR title?
----------------------------------------------------------------
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]