Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

How to convert numeric value stored in histogram data to timestamp

In "Customer Use Cases" part of "Tuning Vertica for Performance at Scale" session in Vertica Unify 2021, I show you the example of the histogram data stored in Vertica to explain why the query plan indicates PREDICATE VALUE OUT-OF-RANGE. That histogram data is for the timestamp data type. Even if the data type is the timestamp, Vertica handles that histogram data as the numeric value. So you need to convert the numeric value to the timestamp value to know the actual value.

To convert it, use:

SELECT to_timestamp_tz((<Value in histogram data> / 1000000) + 946684800);
Tagged:
Sign In or Register to comment.

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.