Hi Zihao,

Thanks for the proposal.

I would like to clarify one semantic point first. My understanding is that
WindowStagger shifts the window boundaries, rather than only delaying when
the
window is fired.

For example, with a 10-minute TUMBLE window and a 2-minute stagger, the
windows
would become [..., 23:52-00:02), [00:02-00:12), ... instead of the globally
aligned [00:00-00:10), [00:10-00:20), ...

If this is correct, KEY_BASED stagger would mean that different keys may
have
different window_start/window_end values. This seems to affect the
observable SQL
TUMBLE semantics, instead of being only a trigger-time load-smoothing
optimization.

Could you clarify whether this is the intended behavior?

Best,
Feng



On Tue, Apr 7, 2026 at 3:14 PM zihao chen <[email protected]> wrote:

> Hi all,
>
> I would like to start a discussion on *FLIP-XXX: Support Window Stagger in
> FlinkSQL and introduce KEY_BASED deterministic stagger*.
>
> Currently, Flink provides WindowStagger to distribute window trigger time
> and reduce burst load (see FLINK-12855: Stagger
> TumblingProcessingTimeWindow processing to distribute workload
> <https://issues.apache.org/jira/browse/FLINK-12855>). However, there are
> two limitations in production usage:
>
>    1. WindowStagger is not supported in Flink SQL TVF tumbling windows
>    2. Existing stagger strategies (e.g., RANDOM, NATURAL) are
>    non-deterministic and may assign records to different windows after
>    recovery, leading to inconsistent results
>
> This FLIP proposes:
>
>    1. Add WindowStagger *support in Flink SQL TUMBLE TVF*
>    2. Introduce a new deterministic stagger strategy: *KEY_BASED*
>       - The stagger offset is computed from the key
>       - Ensures consistent window assignment before and after recovery
>
> Example syntax:
>
> TUMBLE(TABLE t, DESCRIPTOR(rowtime), INTERVAL '1' HOUR, 'RANDOM')
>
> TUMBLE(TABLE t, DESCRIPTOR(rowtime), INTERVAL '1' HOUR, INTERVAL '5'
> MINUTE, 'RANDOM')
>
> The detailed designs are described in the FLIP document:
>
>
> https://docs.google.com/document/d/12NX_s-2HI1C9qjw4two0OHeYfX8YBMiBsq1X6lCfiW0/edit?tab=t.0#heading=h.alqmv4gpvbz7
>
> Looking forward to your feedback.
>
>
> Best regards,
>
> Zihao Chen
>

Reply via email to