execution_engine_profiles value for counters "start time" and "end time"
table execution_engine_profiles has many counters.
in documentation value for counter "start time" described as "Time (timestamp) when HP Vertica started to process the operation."
when I query table execution_engine_profiles for counter "start time" I see number =
456548442250721
I tried
select TO_timestamp(456548442250721);
select date(456548442250721);
but got some unrealistic results. so obviously it was not it.
how do I convert this number to actual and correct timestamp ?
in documentation value for counter "start time" described as "Time (timestamp) when HP Vertica started to process the operation."
when I query table execution_engine_profiles for counter "start time" I see number =
456548442250721
I tried
select TO_timestamp(456548442250721);
select date(456548442250721);
but got some unrealistic results. so obviously it was not it.
how do I convert this number to actual and correct timestamp ?
0
Comments
/Sajan
When I run
select TO_timestamp(456548442250721/1000000);
I get "1984-06-20 03:00:42.250721"
but I know that my timestamp should be between "6/20/2014 2:48:25 AM" and "6/20/2014 3:01:59 AM"
looks like I am off by 30 years. Funny thing that month, day and time look reasonable.
Any thoughts ?
I will try to run some sample data and check, or someone from Vertica can confirm if the microseconds indeed start from 2000?
/Sajan
select to_timestamp ( 456548442250721 / 1000000.0 + 946684800);
Sharon solution is correct,
* TS div 1000000 - because its internal representation in microseconds, while function should get seconds.
* ADD 946684800 - because epoch is from '1970-01-01 02:00:00', i.e. interval of 0 seconds is '1970-01-01 02:00:00'.