You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Kent Yao (Jira)" <ji...@apache.org> on 2020/06/01 02:56:00 UTC
[jira] [Created] (SPARK-31880) Adjacent value parsing not supported
for Localized Patterns because JDK bug
Kent Yao created SPARK-31880:
--------------------------------
Summary: Adjacent value parsing not supported for Localized Patterns because JDK bug
Key: SPARK-31880
URL: https://issues.apache.org/jira/browse/SPARK-31880
Project: Spark
Issue Type: Sub-task
Components: SQL
Affects Versions: 3.0.0, 3.1.0
Reporter: Kent Yao
{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