Skip to content
About
Main content

Triggers and accumulation mode

When should a window's result be emitted, and how must the trigger mode match the sink?

Once results are provisional, when to emit a result becomes a separate question from what to compute. A is the rule that decides when a 's result is emitted. Relative to the there are three classes:

ClassWhenCharacter
Before the watermark reaches the window end (for example every minute)Speculative, incomplete, low latency
On-timeWhen the watermark passes the window endThe declared-complete answer
LateFor each late record, or in , after on-timeCorrections

Accumulation mode: the knob people miss

The second knob matters more and is often missed: . When a window fires again, does it emit the new total or only the change since the last fire?

  • Accumulating: emit the new total (3,100, then 3,260). The must overwrite by key, so the sink must be and mutable.
  • Discarding: emit only the delta (3,100, then +160). The sink must be additive and must have received every earlier fire exactly once.

So the algebra of the sink. Getting it wrong gives double counting that stays invisible until someone compares totals with the source.

Early firings carry an unstated contract

A dashboard whose count rises and then falls is not a pipeline bug. It is a who was never told the number was provisional. That failure is informational, not technical, and no amount of engineering can fix it. Early results must be labelled as early.