Tuesday 15 November 2022

Hive: from_unixtime: Convert the epoch time to a date

Signature

from_unixtime(bigint number_of_seconds [, string format])

 

Convert epoch seconds to the date in given format.

hive> SELECT from_unixtime(1649767043);
OK
_c0
2022-04-12 05:37:23
Time taken: 0.047 seconds, Fetched: 1 row(s)
hive> ;
hive> SELECT from_unixtime(1649767043, 'yyyy-MM-dd');
OK
_c0
2022-04-12
Time taken: 0.064 seconds, Fetched: 1 row(s)

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment