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 2024/07/08 13:31:00 UTC
[jira] [Assigned] (SPARK-48776) XML, JSON and CSV default timestamp formatting fails for seconds offset
[ https://issues.apache.org/jira/browse/SPARK-48776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Wenchen Fan reassigned SPARK-48776:
-----------------------------------
Assignee: Milan Stefanovic
> XML, JSON and CSV default timestamp formatting fails for seconds offset
> -----------------------------------------------------------------------
>
> Key: SPARK-48776
> URL: https://issues.apache.org/jira/browse/SPARK-48776
> Project: Spark
> Issue Type: Bug
> Components: Spark Core
> Affects Versions: 3.5.0, 4.0.0
> Reporter: Milan Stefanovic
> Assignee: Milan Stefanovic
> Priority: Major
> Labels: pull-request-available
>
> Older dates for certain timezones (e.g. America/Los_Angeles) have wierd offsets - such as: -07:52:58.
> JSON, XML and CSV default ISO timestamp formatter is using `XXX` for format which omits seconds information, so we end up with wrong result.
> example:
> sql("SET spark.sql.session.timeZone=America/Los_Angeles")
> sql("SELECT to_json(struct(CAST('1800-01-01T00:00:00+00:00' AS TIMESTAMP) AS ts))").show(false)
> will display:
> {"ts":"1799-12-31T16:07:02.000-07:52"} and hence we will lose 58 seconds
--
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