Handle Beam watermarks, allowed lateness, and WithTimestamps

domain: data-engineering · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Assign event-time timestamps to each element via DoFn or the WithTimestamps transform, returning the event timestamp extracted from the element's fields.
  2. Provide a BoundedOutOfOrdernessTimestampPolicy or custom WatermarkEstimator if your source is unbounded (e.g., Kafka); this tells Beam how far behind real-time the watermark lags.
  3. Call .withAllowedLateness(Duration.standardSeconds(...)) on the Window transform to keep window state open for a grace period after the watermark passes the window end.
  4. Elements arriving after allowed lateness has elapsed are dropped by default; handle them with a side output if you need to inspect them.
  5. Monitor the watermark lag metric in the Dataflow UI or runner metrics to tune the lag estimate.

Known gotchas

Related routes

Implement Flink event-time windowing with watermarks and handle late records via side outputs
nightlies.apache.org/flink · 6 steps · unrated
Define watermarks and event-time windows in RisingWave
docs.risingwave.com · 6 steps · unrated
Configure Spark Structured Streaming watermarking to handle late-arriving data and bound state size
spark.apache.org · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans