Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
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