rollup to combine state
aggregates from 15-minute buckets into daily buckets.
Samples
Combine multiple state aggregates and calculate the duration spent in theSTART state.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Combine multiple state aggregates
rollup to combine state
aggregates from 15-minute buckets into daily buckets.
START state.
WITH buckets AS (SELECT
time_bucket('1 minute', ts) as dt,
state_agg(ts, state) AS sa
FROM states_test
GROUP BY time_bucket('1 minute', ts))
SELECT duration_in(
'START',
rollup(buckets.sa)
)
FROM buckets;
rollup(
agg StateAgg
) RETURNS StateAgg
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| agg | StateAgg | - | ✔ | State aggregates created using state_agg |
| Column | Type | Description |
|---|---|---|
| agg | StateAgg | A new state aggregate that combines the input state aggregates |