In stream processing, time windows are time intervals based on which we can divide events and perform data computations.
tumble()
and hop()
respectively. For session window, RisingWave supports it by a special type of window function frame, i.e. SESSION
frame.
window_start
and window_end
. The two augmented columns represent the start and end of time windows respectively.
tumble()
time window functiontumble()
is as follows:
2022-01-01 10:00:00+00:00
.INTERVAL
type.
Example: INTERVAL '2 MINUTES'
. The standard SQL format, which places time units outside of quotation marks (for example, INTERVAL '2' MINUTE
), is also supported.window_size = INTERVAL '10 MINUTES', offset = INTERVAL '2 MINUTES'
will yield time window starts like 2022-01-01 00:12:00+00:00
.taxi_trips
, that consists of these columns: trip_id
, taxi_id
, completed_at
, distance
, and duration
.
hop()
time window functionhop()
time window function also assigns each row a time window with a fixed size, which is very similar to tumble()
, except that the assigned time windows may overlap.
hop()
time window function.
2022-01-01 10:00:00+00:00
.INTERVAL
type.
For example: INTERVAL '2 MINUTES'
. The standard SQL format, which places time units outside of quotation marks (for example, INTERVAL '2' MINUTE
), is also supported.window_size = INTERVAL '10 MINUTES', offset = INTERVAL '2 MINUTES'
will yield time window starts like 2022-01-01 00:12:00+00:00
.SESSION
frame. You can refer to Window function calls for detailed syntax.
SESSION
frame is only supported in batch mode and emit-on-window-close streaming mode.tumble()
and hop()
time window functions, that is, to assign each row a time window by augmenting it with window_start
and window_end
.
generate_series()
to fill in missing intervals.
2022-07-01 22:04:00 - 2022-07-01 22:06:00
is missing because no trips were recorded during that interval.
0
filling for missing intervals.
taxi_simple
that has the following data:
taxi_trips
and taxi_fare
.
The taxi_fare
table has the following data: