You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Sergey Shelukhin (JIRA)" <ji...@apache.org> on 2016/08/03 18:55:21 UTC

[jira] [Comment Edited] (HIVE-14412) Add a timezone-aware timestamp

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

Sergey Shelukhin edited comment on HIVE-14412 at 8/3/16 6:54 PM:
-----------------------------------------------------------------

Doesn't the problem only exist at the time of parsing back/forth, not storage time?
When you parse a string into timestamp, it refers to an unambiguous UTC value. If the string has TZ information it's 100% unambiguous, if it doesn't I'm assuming the local tz is implied, perhaps we could clarify the UDFs or add missing ones with explicit TZ.
When converting TZ to string the same applies, the TZ is either specified or comes from the environment.
Storing the original TZ with the UTC timestamp doesn't resolve the first one, it may make the 2nd one less confusing, but it can also make it more confusing if the dates come in a strange TZ to a different reader. If user wants to store original TZ they can store it manually (or at least perhaps it should be explicit in the datatype, if possible).


was (Author: sershe):
Doesn't the problem only exist at the time of parsing back/forth, not storage time?
When you parse a string into timestamp, it refers to an unambiguous UTC value. If the string has TZ information it's 100% unambiguous, if it doesn't I'm assuming the local tz is implied, perhaps we could clarify the UDFs or add missing ones with explicit TZ.
When converting TZ to string the same applies, the TZ is either specified or comes from the environment.
Storing the original TZ with the UTC timestamp doesn't resolve the first one, it may make the 2nd one less confusing, but it can also make it more confusing if the dates come in a strange TZ to a different reader.

> Add a timezone-aware timestamp
> ------------------------------
>
>                 Key: HIVE-14412
>                 URL: https://issues.apache.org/jira/browse/HIVE-14412
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Hive
>            Reporter: Rui Li
>            Assignee: Rui Li
>
> Java's Timestamp stores the time elapsed since the epoch. While it's by itself unambiguous, ambiguity comes when we parse a string into timestamp, or convert a timestamp to string, causing problems like HIVE-14305.
> To solve the issue, I think we should make timestamp aware of timezone.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)