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

Jason Dere commented on HIVE-14412:
-----------------------------------

bq. 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.

I'm not sure what to do here - I feel like proper comparison is an important 
detail, and that users might be alarmed if the data they are collecting in 
various time zones are not capable of being compared to each other. I wonder if 
it would worth creating a new BinarySortableSerDe which allows the value to 
specify how many bytes of the value need to be compared. Something like that 
might allow the TimestampTZ to specify that only the UTC time portion be used 
for comparison.

If anything, I think the most important detail for a new Timestamp type in Hive 
would be to make sure that it actually captures the "seconds from UTC" value 
and that all of the various SerDes/UDFs/conversions actually pay attention to 
this detail. The formatting/Timezone could even be done as an operation on the 
UTC time (formatting UDF, session-level timezone, or just use local timezone).


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

Reply via email to