[ https://issues.apache.org/jira/browse/HIVE-14412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15528517#comment-15528517 ]
Rui Li commented on HIVE-14412: ------------------------------- [~jdere], thank you for the comments and trying this out. bq. Is there a way to convert TimestampTZ to a different TZ? We don't have such a UDF yet. But it's easy to implement - {{TimestampTZ::setOffsetInMin}} should serve the purpose. bq. the time zone should not be used for comparison I thought about this. One difficulty is we need to serialize TimestampTZ into BytesWritable in BinarySortableSerDe. The timezone needs to be serialized into the BytesWritable. I'm not sure how to keep it from being used for comparison. bq. Is there way to keep non-numeric timezones, like ‘America/Los_Angeles’ rather than ‘GMT-08:00'? I chose the GMT format because it saves space, and is guaranteed to be understood by TimeZone. Whether a non-numeric timezone ID is recognizable depends on local environment, and may vary among different nodes in a cluster. One shortcoming of the GMT format is it's difficult to support functions that modify the TimestampTZ, e.g. {{date_add}}. Because for example, ‘America/Los_Angeles’ maps to different GMT formats in different time of the year, due to DST. So I think we should recommend the user to use the GMT format in the first place. Is this acceptable? > 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 > Attachments: HIVE-14412.1.patch, HIVE-14412.2.patch, > HIVE-14412.3.patch, HIVE-14412.4.patch, HIVE-14412.5.patch, > HIVE-14412.6.patch, HIVE-14412.7.patch, HIVE-14412.8.patch > > > 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)