Downstream batch jobs need to know when a time partition is complete before they run.
In the new stream-based ingestion, data keeps arriving after the wall-clock hour, so early runs miss updates.
The team solved it by: 👉 Extending the Flink-to-Iceberg sink with Accumulators to collect event-time stats per checkpoint. 👉 Adding a CommitProcessor that reads those stats, computes a non-regressing watermark, and writes it as a table property. 👉 Propagating the watermark from the CDC table to the base table during the Spark upsert commit.
The parts that matter: 1️⃣ Flink-to-Iceberg sink - writes CDC records to Iceberg and creates snapshots 2️⃣ Accumulator - aggregates min, max and percentile sketch of event times per writer subtask
Downstream jobs can safely gate processing on the watermark stored as an Iceberg table property, eliminating missed updates.
Tables can choose a conservative watermark based on the minimum event time or a fresher one using a high percentile; the latter reduces latency but may accept rare late records after a partition is marked final. The choice is a trade-off between completeness and freshness.
How do you balance latency versus completeness when defining finalization policies for streaming partitions?