You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2019/11/19 09:12:00 UTC
[jira] [Resolved] (SPARK-29949) JSON/CSV formats timestamps
incorrectly
[ https://issues.apache.org/jira/browse/SPARK-29949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wenchen Fan resolved SPARK-29949.
---------------------------------
Fix Version/s: 2.4.5
Resolution: Fixed
Issue resolved by pull request 26582
[https://github.com/apache/spark/pull/26582]
> JSON/CSV formats timestamps incorrectly
> ---------------------------------------
>
> Key: SPARK-29949
> URL: https://issues.apache.org/jira/browse/SPARK-29949
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 2.4.4
> Reporter: Maxim Gekk
> Assignee: Maxim Gekk
> Priority: Major
> Fix For: 2.4.5
>
>
> For example:
> {code}
> scala> val t = java.sql.Timestamp.valueOf("2019-11-18 11:56:00.123456")
> t: java.sql.Timestamp = 2019-11-18 11:56:00.123456
> scala> Seq(t).toDF("t").select(to_json(struct($"t"), Map("timestampFormat" -> "yyyy-MM-dd HH:mm:ss.SSSSSS"))).show(false)
> +-------------------------------------------------+
> |structstojson(named_struct(NamePlaceholder(), t))|
> +-------------------------------------------------+
> |{"t":"2019-11-18 11:56:00.000123"} |
> +-------------------------------------------------+
> {code}
--
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