Aihua Xu commented on HIVE-3454:

I agree that for non thread-safe statics, it will cause problems for 
multi-threading, while for constants or immutable objects, I guess you would 
share across threads rather than creating each copy for each thread. This is 
the case of a java primitive that we initialize once and use/read later by 

Regarding UDF approach, I looked into that and it seems promising, while the 
current approach actually only evaluates the value when the type is timestamp. 
I guess it would be the same as UDF approach. 

> Problem with CAST(BIGINT as TIMESTAMP)
> --------------------------------------
>                 Key: HIVE-3454
>                 URL: https://issues.apache.org/jira/browse/HIVE-3454
>             Project: Hive
>          Issue Type: Bug
>          Components: Types, UDF
>    Affects Versions: 0.8.0, 0.8.1, 0.9.0, 0.10.0, 0.11.0, 0.12.0, 0.13.0, 
> 0.13.1
>            Reporter: Ryan Harris
>            Assignee: Aihua Xu
>              Labels: newbie, newdev, patch
>         Attachments: HIVE-3454.1.patch.txt, HIVE-3454.2.patch, 
> HIVE-3454.3.patch, HIVE-3454.4.patch, HIVE-3454.patch
> Ran into an issue while working with timestamp conversion.
> CAST(unix_timestamp() as TIMESTAMP) should create a timestamp for the current 
> time from the BIGINT returned by unix_timestamp()
> Instead, however, a 1970-01-16 timestamp is returned.

This message was sent by Atlassian JIRA

Reply via email to