Link to home
Start Free TrialLog in
Avatar of kshathrya
kshathrya

asked on

hive date datatype with 6 digit nano seconds

what function to use in hive for getting time with nanoseconds?

tried functions like:
unix_timestamp
from_unixtime
but not getting the nano seconds

i get the bigint value but what conversion to use to get the 6 digits after the seconds


or can that be gotten from teradata?
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Extremely few systems work with that level of precision.  A rubidium vapor frequency standard would not be good enough(it is almost good enough)  you would need a cesium beam frequency standard  A temperature compensated crystal oscillator you get about  1.1 x 10^-8   A line frequency clock would be entirely and completely unusable (line frequency is very stable over the LONG period but all over the place in the short time period.

when dealing with this accuracy of time everything has to be taken into account i.e.
National bureau of standards publishes monthly statistics of the previous month's delays and other pertinent data. You can't use the internet since you have no idea of what path was taken each and every time you do a measurement.

I dealt with 500hz ground wave standards and the distance between the transmitter and the receivers antennas where known.
We would get the data of the transmitters delay, the cable delay and the antenna delay and the gps position of the antenna (transmitted) .. Since our receiving antenna was fixed we could work out the distance and we already knew the specific antennas delay, transmission feed delay and the receivers delay.

Getting time to 10^-9 is a difficult and expensive process gps time isn't sufficient as it is on the order of 40 nanoseconds 95% of the time.  

Note computers don't use temperature controlled crystal oscillators

Various operating systems and languages time accuracy https://en.wikipedia.org/wiki/System_time
Avatar of kshathrya
kshathrya

ASKER

I want output like this what hive function can get me this?
basically with 6 digits ex.

10-Jun-15 11.45.23.564567 AM

Open in new window


hive hadoop
or Teradata date function that can get me this kind of output is what i am looking for
In Teradata, you can use timestamp(6) datatype to get 6 digits after seconds.

https://forgetcode.com/teradata/1352-difference-between-timestamp-0-and-timestamp-6 

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.