Bounding Stateful Streaming State with Apache Spark Event-Time Watermarks
Use Spark Structured Streaming watermarks to bound state for dropDuplicates and aggregations, choose a delay based on acceptable lateness, and verify late-record handling before production.