[ https://issues.apache.org/jira/browse/HIVE-10488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14519846#comment-14519846 ]
Chaoyu Tang commented on HIVE-10488: ------------------------------------ [~the6campbells] I was also not able to reproduce the issue in Hive 1.2. Here are my steps: {code} create table testcastts (key int, datevalue date); insert into testcastts select 0, null from src limit 1; insert into testcastts select 1, date '1996-01-01' from src limit 1; insert into testcastts select 2, date '2000-01-01' from src limit 1; insert into testcastts select 3, date '2000-12-31' from src limit 1; --- select key, datevalue, cast(datevalue as timestamp) from testcastts; 0 NULL NULL 1 1996-01-01 1996-01-01 00:00:00 2 2000-01-01 2000-01-01 00:00:00 3 2000-12-31 2000-12-31 00:00:00 --- create table if not exists testcastorcts (key int, datevalue date) stored as orc; insert overwrite table testcastorcts select * from testcastts; select key, datevalue, cast(datevalue as timestamp) from testcastorcts; 0 NULL NULL 1 1996-01-01 1996-01-01 00:00:00 2 2000-01-01 2000-01-01 00:00:00 3 2000-12-31 2000-12-31 00:00:00 {code} Do you see any difference between above my test case and yours? Otherwise, I will resolve this JIRA as "Not Reproducible". Thanks > cast DATE as TIMESTAMP returns incorrect values > ----------------------------------------------- > > Key: HIVE-10488 > URL: https://issues.apache.org/jira/browse/HIVE-10488 > Project: Hive > Issue Type: Bug > Components: SQL > Affects Versions: 0.13.1 > Reporter: N Campbell > Assignee: Chaoyu Tang > > same data in textfile works > same data loaded into an ORC table does not > connection property of tez/mr makes no difference. > select rnum, cdt, cast (cdt as timestamp) from tdt > 0 <null> <null> > 1 1996-01-01 1969-12-31 19:00:09.496 > 2 2000-01-01 1969-12-31 19:00:10.957 > 3 2000-12-31 1969-12-31 19:00:11.322 > vs > 0 <null> <null> > 1 1996-01-01 1996-01-01 00:00:00.0 > 2 2000-01-01 2000-01-01 00:00:00.0 > 3 2000-12-31 2000-12-31 00:00:00.0 > create table if not exists TDT ( RNUM int , CDT date ) > STORED AS orc ; > insert overwrite table TDT select * from text.TDT; > 0|\N > 1|1996-01-01 > 2|2000-01-01 > 3|2000-12-31 -- This message was sent by Atlassian JIRA (v6.3.4#6332)