You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/07/11 01:25:00 UTC
[jira] [Assigned] (SPARK-39731) Correctness issue when parsing dates with yyyyMMdd format in CSV
[ https://issues.apache.org/jira/browse/SPARK-39731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Apache Spark reassigned SPARK-39731:
------------------------------------
Assignee: Apache Spark
> Correctness issue when parsing dates with yyyyMMdd format in CSV
> ----------------------------------------------------------------
>
> Key: SPARK-39731
> URL: https://issues.apache.org/jira/browse/SPARK-39731
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.4.0
> Reporter: Ivan Sadikov
> Assignee: Apache Spark
> Priority: Major
>
> In Spark 3.x, when reading CSV data like this:
> {code:java}
> name,mydate
> 1,2020011
> 2,20201203{code}
> and specifying date pattern as "yyyyMMdd", dates are not parsed correctly with CORRECTED time parser policy.
> For example,
> {code:java}
> val df = spark.read.schema("name string, mydate date").option("dateFormat", "yyyyMMdd").option("header", "true").csv("file:/tmp/test.csv")
> df.show(false){code}
> Returns:
> {code:java}
> +----+--------------+
> |name|mydate |
> +----+--------------+
> |1 |+2020011-01-01|
> |2 |2020-12-03 |
> +----+--------------+ {code}
> and it used to return null instead of the invalid date in Spark 3.2 or below.
>
> The issue appears to be caused by this PR: [https://github.com/apache/spark/pull/32959].
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org