Mostly HarmlessWindows & triggers

Watermark trigger

The watermark trigger fires a window once, when the watermark passes its end, and it is the trigger you almost always want.

Also called: event-time trigger

Watermark trigger - the default rule for when a window emits: the watermark trigger fires a window once, at the moment the watermark passes the window's end. The watermark is the engine's claim that no events older than time T are still coming; once T is past the end of the window, the window has seen everything it is going to see, so it closes, emits, and frees its state.

The guarantee is only as good as the watermark under it. Fire on a watermark that runs ahead of reality and the stragglers arrive after the window is gone. That is a watermark-tuning problem rather than a trigger problem; the trigger itself is one comparison.

Do you need it? Yes, and you almost certainly need nothing else. It is the default in Flink and in the Dataflow model because "emit each window once, when it is complete" is what nearly every job means by windowing. In ubik it is the whole story: windows close when the watermark passes their end, --watermark-delay holds them open longer for late data, and anything later still is counted in late_dropped. The right trigger is the one you never configure.

Sources

Related