You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Maxim Gekk (Jira)" <ji...@apache.org> on 2019/11/18 17:50:00 UTC

[jira] [Created] (SPARK-29949) JSON/CSV formats timestamps incorrectly

Maxim Gekk created SPARK-29949:
----------------------------------

             Summary: 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


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