In your CREATE TABLE DDL, declare a column of type TIMESTAMP(3) or TIMESTAMP_LTZ(3) that holds the event timestamp.
Add a WATERMARK FOR <ts_col> AS <ts_col> - INTERVAL '<lateness>' declaration to define the watermark strategy.
For source-provided timestamps (e.g., Kafka record timestamps), use TIMESTAMP_LTZ(3) METADATA FROM 'timestamp' and then apply the WATERMARK clause on that metadata column.
Verify the watermark is advancing by running a simple windowed query and observing that results are emitted.
For bounded-out-of-orderness, tune the INTERVAL based on observed source delivery delay.
Use the Flink Web UI or metrics to inspect current watermark per task and identify stragglers.
Known gotchas
A single idle source partition will stall the watermark for the entire task; configure watermark-idleness timeout (table.exec.source.idle-timeout) to prevent global stalls.
TIMESTAMP and TIMESTAMP_LTZ behave differently with time zones; use TIMESTAMP_LTZ for event-time when records originate from multiple time zones.
Retroactively adding a watermark to an existing table requires recreating it; plan watermark strategy before deploying to production.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp