spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Takeshi Yamamuro (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-24778) DateTimeUtils.getTimeZone method returns GMT time if timezone cannot be parsed
Date Wed, 11 Jul 2018 02:53:00 GMT

    [ https://issues.apache.org/jira/browse/SPARK-24778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16539478#comment-16539478
] 

Takeshi Yamamuro commented on SPARK-24778:
------------------------------------------

I think that it is more reasonable to reject the unparsed cases? e.g., in postgresql,
{code:java}
postgres=# SELECT now() AT TIME ZONE 'Asia/Tokyo';
          timezone          
----------------------------
2018-07-11 11:45:12.626255
(1 row)

postgres=# SELECT now() AT TIME ZONE 'unknown';
ERROR:  time zone "unknown" not recognized
{code}
Anyway, we might hesitate to change this behaviour in minor releases, so we might hold it
until next major releases. cc: [~ueshin]

> DateTimeUtils.getTimeZone method returns GMT time if timezone cannot be parsed
> ------------------------------------------------------------------------------
>
>                 Key: SPARK-24778
>                 URL: https://issues.apache.org/jira/browse/SPARK-24778
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.3.1
>            Reporter: Vinitha Reddy Gankidi
>            Priority: Major
>
> {{DateTimeUtils.getTimeZone}} calls java's {{Timezone.getTimezone}} method that defaults
to GMT if the timezone cannot be parsed. This can be misleading for users and its better to
return NULL instead of returning an incorrect value. 
> To reproduce: {{from_utc_timestamp}} is one of the functions that calls {{DateTimeUtils.getTimeZone}}.
Session timezone is GMT for the following queries.
> {code:java}
> SELECT from_utc_timestamp('2018-07-10 12:00:00', 'GMT+05:00') -> 2018-07-10 17:00:00

> SELECT from_utc_timestamp('2018-07-10 12:00:00', '+05:00') -> 2018-07-10 12:00:00
(Defaults to GMT as the timezone is not recognized){code}
> We could fix it by using the workaround mentioned here: [https://bugs.openjdk.java.net/browse/JDK-4412864].



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


Mime
View raw message