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/03/19 07:14:00 UTC

[jira] [Created] (SPARK-27199) Replace TimeZone by ZoneId in TimestampFormatter API

Maxim Gekk created SPARK-27199:
----------------------------------

             Summary: Replace TimeZone by ZoneId in TimestampFormatter API
                 Key: SPARK-27199
                 URL: https://issues.apache.org/jira/browse/SPARK-27199
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 2.4.0
            Reporter: Maxim Gekk


Internally, TimestampFormatter implementations use ZoneId but not TimeZone which comes via API. Conversion from TimeZone to ZoneId is not for free. Actually, TimeZone is converted to String, and the String and parsed to ZoneId. The conversion to String can be eliminated if TimestampFormatter would accept ZoneId. And also, TimeZone is converted from String in some cases (JSON options). So, in bad case String -> TimeZone -> String -> ZoneId -> ZoneOffset. The ticket aims to use ZoneId in TimestampFormatter API. We could require ZoneOffset but it is not convenient in most cases because conversion ZoneId to ZoneOffset requires Instant. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org