Skip to main content

Time of Day

Usage

A Time of Day filter is a UI control for selecting a single time of day (hour, minute and second).

image-300 image-300

A time-of-day filter is used in a condition on a time-of-day SQL expression.

Syntax
{[<time_expr>]=<filter_variable_name>}

The <time_expr> must either be an expression of type TIME or an expression that can be implicitly cast to TIME. The filter input value that the expression is compared to is always generated by Cluvio as a database-specific time-of-day literal, as in TIME '13:45:31'. For example, the parameterised SQL query

SELECT *
FROM logs
WHERE {log_time=my_time_filter}

with a selected input time of 13:45:31 results in database-specific SQL similar to the following:

SELECT *
FROM logs
WHERE log_time = TIME '13:45:31'
Time of Day Equality

A time-of-day filter only creates time equality conditions in SQL. For filtering time-of-day ranges, see the Time of Day Range filter instead.

Configuration

TO configure a time-of-day filter, select the Time UI control type in the filter definition dialog.

Edit Filter Edit Filter

The Value Type of a time-of-day filter is always Time.

Use the Configuration tab to set a default value and further configuration options.

Value Selectors

A value selector allows to tap into SQL value expressions associated with the selected time-fo-day.

Time-of-Day Value

SELECT {my_time.value}

The .value selector produces a database-specific time-of-day value expression or NULL if no value is selected.

Selected

SELECT *
FROM event
WHERE
CASE
WHEN {my_time.selected} = TRUE THEN {starttime=my_time}
ELSE starttime = TIME '00:00:00'
END

The .selected selector produces a database-specific boolean expression that is true when a value is selected for the filter, false otherwise.