OPAL Time Functions

Time functions provide conversion to and from various time and date formats.

Function

Description

avg

Calculate the arithmetic average of the input expression across the group.

bin_end_time

Returns the end time of the current bin (exclusive).

bin_start_time

Returns the start time of the current bin (inclusive).

duration

Convert a number or timestamp, or a time interval, to a duration.

duration_hr

Convert a number of hours to a duration.

duration_min

Convert a number of minutes to a duration.

duration_ms

Convert a number of milliseconds to a duration.

duration_null

Returns a null value of type duration.

duration_sec

Convert a number of seconds to a duration.

format_time

Format the timestamp value in UTC according to the specified format.

from_milliseconds

Given a numeric value representing milliseconds since epoch, return a timestamp of that point in time.

from_nanoseconds

Given a numeric value representing nanoseconds since epoch, return a timestamp of that point in time.

from_seconds

Given a numeric value representing seconds since epoch, return a timestamp of that point in time.

median

Return the fast approximate median value of one column.

median_exact

Return the exact median value of one column.

parse_isotime

Parse a YYYY-MM-DDTHH:MM:SSZ-formatted string as a timestamp.

percentile

Returns an approximated value for the specified percentile of the input expression across the group.

percentile_cont

Assuming a continuous distribution, it returns the value for the specified percentile of the input expression across the group.

percentile_disc

Assuming a discrete distribution, it returns the value for the specified percentile of the input expression across the group.

query_end_time

Returns the latest time of the query time window.

query_start_time

Returns the earliest time of the query time window.

row_end_time

Returns the time at which the state in the row ended, or null for non-resource datasets.

row_timestamp

Returns the timestamp (start time) of the row.

stddev

Calculate the standard deviation across the group.

sum

Calculate the sum of the argument across the group, or of the scalar arguments if more than one.

timestamp_null

Returns a null value of type timestamp.

valid_for

Specify the validity period for each event for some verbs