- Categories:
UNIX_ ZERO_ PERCENT (system data metric function)¶
Returns the percentage of column values that are equal to the Unix epoch, 1970-01-01. The percentage is computed over the
total row
count, including NULL values in the denominator.
This topic provides the syntax for calling the function directly. To learn how to associate the function with a table or view so it runs at regular intervals, see Associate a DMF.
Syntax¶
Arguments¶
querySpecifies a SQL query that projects a single column.
Allowed data types¶
The column projected by the query must have one of the following data types:
DATETIMESTAMP_LTZTIMESTAMP_TZ
Returns¶
The function returns a FLOAT value. The function returns NULL if the table or view has no rows.
Usage notes¶
- A value at the Unix epoch often means that a timestamp conversion failed and defaulted to zero.
- For a
DATEcolumn, the function counts the date1970-01-01. For aTIMESTAMP_LTZorTIMESTAMP_TZcolumn, the function counts values at the instant1970-01-01 00:00:00 UTC, whatever their time zone offset. For example,1969-12-31 16:00:00 -08:00is counted, but1970-01-01 00:00:00 +05:00isn’t. - The result does not depend on the
TIMESTAMP_INPUT_FORMATsession parameter.
Example¶
Measure the percentage of Unix-epoch timestamps in the created_at column: