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

Venkata Ramana G commented on HIVE-3454:
----------------------------------------

I am using 0.12 release still this problems exists. Inconsistancy in casting.

select cast(cast(cast(1000 as INT) as TIMESTAMP) as INT) from src limit 1;      
                 result:  1
select cast(cast(cast(1000 as BIGINT) as TIMESTAMP) as BIGINT) from src limit 
1;           result:  1
select cast(cast(cast(1000.0 as DOUBLE) as TIMESTAMP) as DOUBLE) from src limit 
1;   result:  1000.0

converting int/bigint/tinyint to timestamp and back to int/bigint/tinyint 
changes the value.
 int/bigint/tinyint/boolean conversion to timestamp, should take input in 
seconds, just like double.

Issue raised in sep/2012, still problem persists. This requires a fix.

> 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
>              Labels: newbie, newdev, patch
>         Attachments: HIVE-3454.1.patch.txt, 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
(v6.3.4#6332)

Reply via email to