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

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

Okay, thanks for clarification. Let's be diligent on updating JIRA for 
trackability.

> 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-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to