How can we deduplicate streaming events with dropDuplicates() while bounding memory with watermarks?
Combining withWatermark() and dropDuplicates(['event_id', 'event_time']) prunes old state after the watermark expires.
Streaming event pipelines processing millions of mobile app click events with bounded cluster memory.
df_deduped_stream = df.withWatermark("event_time", "2 hours").dropDuplicates(["event_id", "event_time"])Practice typing production-grade PySpark code for Handling Late-Arriving Duplicates via Watermarking.