[ https://issues.apache.org/jira/browse/HIVE-14305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15391260#comment-15391260
]
Rui Li commented on HIVE-14305:
-------------------------------
[~rdblue], I think that effectively requires us to set UTC as default timezone throughout
the whole query. IIUC, Timestamp is a wrapper of Date plus nano second info. If we want the
computation performed in UTC, we need to call {{Timezone.setDefault}} to set default timezone.
This method is JVM-wide and not thread safe, which means we cannot set UTC for specific computation
and then switch back to system default timezone.
Not sure if this is acceptable. Also pinging [~xuefuz], [~szehon], [~sershe] for opinions.
> To/From UTC timestamp may return incorrect result because of DST
> ----------------------------------------------------------------
>
> Key: HIVE-14305
> URL: https://issues.apache.org/jira/browse/HIVE-14305
> Project: Hive
> Issue Type: Sub-task
> Reporter: Rui Li
> Assignee: Rui Li
>
> If the machine's local timezone involves DST, the UDFs return incorrect results.
> For example:
> {code}
> select to_utc_timestamp('2005-04-03 02:01:00','UTC');
> {code}
> returns {{2005-04-03 03:01:00}}. Correct result should be {{2005-04-03 02:01:00}}.
> {code}
> select to_utc_timestamp('2005-04-03 10:01:00','Asia/Shanghai');
> {code}
> returns {{2005-04-03 03:01:00}}. Correct result should be {{2005-04-03 02:01:00}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
|