[ https://issues.apache.org/jira/browse/HIVE-21101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Markus Steindl updated HIVE-21101: ---------------------------------- Description: Assume I want to insert "2017-07-14 02:40:00 UTC" (1500000000 seconds since epoch) into a timestamp column. {{create table timestamp_test(ts timestamp)}} {{insert into timestamp_test select * from (select 1.5e9) t;}} However, Hive writes "2017-07-14 04:40:00" into the CSV. I suppose it interprets the timestamp as CET (timezone of the cluster) and converts it to UTC by adding 2 hours. Also none of the following works: {{insert into timestamp_test select * from (select 1500000000000) t;}} {{insert into timestamp_test select * from (select cast(1.5e9 as timestamp)) t;}} {{insert into timestamp_test select * from (select cast(cast(1.5e9 as timestamp) as string)) t;}} {{insert into timestamp_test select * from (select "2017-07-14 02:40:00") t;}} {{insert into timestamp_test select * from (select cast("2017-07-14 02:40:00" as timestamp)) t;}} {{insert into timestamp_test select * from (select from_utc_timestamp(1.5e9, "CET")) t;}} {{insert into timestamp_test select * from (select from_utc_timestamp(1.5e9, "UTC")) t;}} We're using Hive 1.2.1000.2.6.0.3-8. was: Assume I want to insert "2017-07-14 02:40:00 UTC" (1500000000 seconds since epoch): {{create table timestamp_test(ts timestamp)}} {{insert into timestamp_test select * from (select 1.5e9) t;}} However, Hive writes "2017-07-14 04:40:00" into the CSV. I suppose it interprets the timestamp as CET (timezone of the cluster) and converts it to UTC by adding 2 hours. Also none of the following works: {{insert into timestamp_test select * from (select 1500000000000) t;}} {{insert into timestamp_test select * from (select cast(1.5e9 as timestamp)) t;}} {{insert into timestamp_test select * from (select cast(cast(1.5e9 as timestamp) as string)) t;}} {{insert into timestamp_test select * from (select "2017-07-14 02:40:00") t;}} {{insert into timestamp_test select * from (select cast("2017-07-14 02:40:00" as timestamp)) t;}} {{insert into timestamp_test select * from (select from_utc_timestamp(1.5e9, "CET")) t;}} {{insert into timestamp_test select * from (select from_utc_timestamp(1.5e9, "UTC")) t;}} We're using Hive 1.2.1000.2.6.0.3-8. > Hive always interprets UTC timestamps as local > ---------------------------------------------- > > Key: HIVE-21101 > URL: https://issues.apache.org/jira/browse/HIVE-21101 > Project: Hive > Issue Type: Bug > Affects Versions: 1.2.0 > Reporter: Markus Steindl > Priority: Major > > Assume I want to insert "2017-07-14 02:40:00 UTC" (1500000000 seconds since > epoch) into a timestamp column. > {{create table timestamp_test(ts timestamp)}} > {{insert into timestamp_test select * from (select 1.5e9) t;}} > However, Hive writes "2017-07-14 04:40:00" into the CSV. > I suppose it interprets the timestamp as CET (timezone of the cluster) and > converts it to UTC by adding 2 hours. > Also none of the following works: > {{insert into timestamp_test select * from (select 1500000000000) t;}} > {{insert into timestamp_test select * from (select cast(1.5e9 as timestamp)) > t;}} > {{insert into timestamp_test select * from (select cast(cast(1.5e9 as > timestamp) as string)) t;}} > {{insert into timestamp_test select * from (select "2017-07-14 02:40:00") t;}} > {{insert into timestamp_test select * from (select cast("2017-07-14 02:40:00" > as timestamp)) t;}} > {{insert into timestamp_test select * from (select from_utc_timestamp(1.5e9, > "CET")) t;}} > {{insert into timestamp_test select * from (select from_utc_timestamp(1.5e9, > "UTC")) t;}} > We're using Hive 1.2.1000.2.6.0.3-8. -- This message was sent by Atlassian JIRA (v7.6.3#76005)