I get the impression that unix_timestamp and from_unixtime . Hive functions are "inverse" to each other.
When I try to convert a timestamp string to a few seconds in Hive:
SELECT unix_timestamp('10-Jun-15 10.00.00.000000 AM', 'dd-MMM-yy hh.mm.ss.MS a');
I get 1418176800.
When I try to convert 1418176800 to a timestamp string:
SELECT from_unixtime(1418176800, 'dd-MMM-yy hh.mm.ss.MS a');
I get 10-Dec-14 10.00.00.120 AM, which is obviously not equal to the original.
Can someone explain what is happening? Thanks.
source share