You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2020/06/12 03:18:00 UTC

[jira] [Commented] (SPARK-31880) Adjacent value parsing not supported for Localized Patterns because of JDK bug

    [ https://issues.apache.org/jira/browse/SPARK-31880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17133874#comment-17133874 ] 

Hyukjin Kwon commented on SPARK-31880:
--------------------------------------

I converted this into a separate issue because SPARK-31408 is fixed in 3.0.0. Let's file another parent issue if there are many of it, and then add a link between parent tickets [~Qin Yao].

> Adjacent value parsing not supported for Localized Patterns because of JDK bug
> ------------------------------------------------------------------------------
>
>                 Key: SPARK-31880
>                 URL: https://issues.apache.org/jira/browse/SPARK-31880
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.0.0, 3.1.0
>            Reporter: Kent Yao
>            Priority: Major
>
> {code:java}
> spark-sql> set spark.sql.legacy.timeParserPolicy=exception;
> spark.sql.legacy.timeParserPolicy	exception
> spark-sql> select to_timestamp('202011', 'YYYYww');
> {code}
> {code:java}
> Caused by: java.time.format.DateTimeParseException: Text '202011' could not be parsed at index 0
> 	at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1949)
> 	at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1777)
> 	at org.apache.spark.sql.catalyst.util.Iso8601TimestampFormatter.$anonfun$parse$1(TimestampFormatter.scala:79)
> 	... 99 more
> {code}
> {code:java}
> spark-sql> set spark.sql.legacy.timeParserPolicy=legacy;
> spark.sql.legacy.timeParserPolicy	legacy
> spark-sql> select to_timestamp('202011', 'YYYYwu');
> 2019-12-30 00:00:00
> spark-sql> select to_timestamp('202011', 'YYYYww');
> 2020-03-08 00:00:00
> {code}
> The result could vary between different JDKs



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org