Skip to content
BENIBIX Learn

Tumbling Window

Data⚙️ ProcessingEvent Time and Windows

Also known as Fixed Window

Windows that are all one size. Each starts when the last ends.

Think of it like

It is like the hours on a clock. Each hour starts when the last one ends, and none overlap.

Example

A power company adds up use in 15-minute windows. Its bills are based on those same blocks.

Why it matters

Each event is counted once, so the windows add up to the whole. Reports and bills need that.

Definition

A tumbling window is a window of fixed size that never overlaps the next one. Each event falls into exactly one window. A 5-minute tumbling window gives one result for 10:00 to 10:05, then one for 10:05 to 10:10, and so on. It is the simplest window and the most common.

Example code

sql
SELECT window_start, page, COUNT(*) AS views
FROM TUMBLE(TABLE clicks, DESCRIPTOR(ts), INTERVAL '5' MINUTES)
GROUP BY window_start, window_end, page;
Flink SQL: page views in 5-minute tumbling windows.
The same events, grouped three ways: tumbling, sliding and session windows.

Common mistake

Using it for a moving average. That needs a sliding window.

Key takeaways

  1. 1
    Fixed size. Every window is the same length.
  2. 2
    No overlap. One window per event.
  3. 3
    Adds up. The windows sum to the whole.

Compare