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

Ryan Blue commented on HIVE-14305:
----------------------------------

The Java Timestamp object retains the zone it was created with and the proposal 
is to create all Timestamps used for internal calculations with UTC. UTC has no 
DST rules and will perform the calculation and print the correct result if its 
toString method is called. It will also return the correct values for getYear 
etc. that are used to implement Hive's time functions. The only behavior change 
from that fix is that methods that specifically depend on the local zone will 
have to be updated because it won't use the local zone automatically.

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

Reply via email to