You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2018/12/13 19:07:00 UTC
[jira] [Commented] (HIVE-21039) CURRENT_TIMESTAMP returns value in
UTC time zone
[ https://issues.apache.org/jira/browse/HIVE-21039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16720494#comment-16720494 ]
Jesus Camacho Rodriguez commented on HIVE-21039:
------------------------------------------------
This was unnoticed in HIVE-12192. Since UDF is returning a timestamp, this should not be dependent on internal representation of the type and thus it should not return it in UTC. Instead, we should use user session time zone to return the correct timestamp.
> CURRENT_TIMESTAMP returns value in UTC time zone
> ------------------------------------------------
>
> Key: HIVE-21039
> URL: https://issues.apache.org/jira/browse/HIVE-21039
> Project: Hive
> Issue Type: Bug
> Affects Versions: 3.1.1
> Reporter: Andrey Zinovyev
> Assignee: Jesus Camacho Rodriguez
> Priority: Major
>
> We're upgrading from hive 1.2 to 3.1 and it seems like new hive returns CURRENT_TIMESTAMP in UTC timezone. But before it was in local (system's default) timezone.
> According to HIVE-5472 current_timestamp should use user's local timezone. This behaviour was changed in HIVE-12192 (if I got it right). GenericUDFCurrentTimestamp now explicitly uses UTC as timezone to initialise org.apache.hadoop.hive.common.type.Timestamp .
> For example
> Old hive:
> {code}
> hive> select current_timestamp;
> OK
> 2018-12-12 22:43:39.024
> {code}
> New hive:
> {code}
> > select current_timestamp;
> +--------------------------+
> | _c0 |
> +--------------------------+
> | 2018-12-12 19:43:57.024 |
> +--------------------------+
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)