Support Questions
Find answers, ask questions, and share your expertise

from_unixtime resolves incorrectly

Contributor

I am on CDH 5.4.8 all servers running NTP and set to GMT

 

I found something very interesting with hive  Hive 1.1.0-cdh5.4.8

running on hive the following command (via CLI)

select from_unixtime(1447546491); 

resolves as 2015-11-14 18:14:51

 

while the same command in impala 

select from_unixtime(1447546491); 

resolves correctly as 

2015-11-15 00:14:51

 

which is the same as unix and http://www.epochconverter.com/

 

While I would like to get away from Hive - I still have somethings that I rely on 

 

is this a bug or a feature or is there a TZ setting I need to consider?

1 REPLY 1

Contributor

Yea there are some inconsistencies in Hive, see the current behavior Hive Wiki and some potential improvements like see HIVE-12193 at a later point.

 

With that maybe HiveCLI being set to another timezone is the only explanation I can think of, although you mentioned server machines are set to GMT/UTC, so I'm not too sure, maybe worth to double-check.