Created 01-05-2018 11:28 AM
I believe the original reason that it took seconds was for compatibility with Mysql's similarly-named function.
You can convert a millisecond unix timestamp into an Impala timestamp more efficiently using integer division/mod and the "interval" operator as follows:
[localhost:21000] > select cast(1513895588243 div 1000 as timestamp) + interval (1513895588243 % 1000) milliseconds; +------------------------------------------------------------------------------------------+ | cast(1513895588243 div 1000 as timestamp) + interval (1513895588243 % 1000) milliseconds | +------------------------------------------------------------------------------------------+ | 2017-12-21 22:33:08.243000000 | +------------------------------------------------------------------------------------------+ Fetched 1 row(s) in 0.01s