DE Mastery GitHub

Apache Spark · SPK-11

Structured Streaming II — watermarks, state, and streaming SCD2

From your world. SCD2 dimension snapshots and late-arriving facts

Practice quiz with instant feedback. For a scored run that counts toward your local progress, use uv run de quiz SPK-11.

1What does a watermark on an event-time column do?
2Why must windowed streaming aggregations use event time rather than processing time?
3A windowed count is written in append output mode. What makes that legal?
4What is the advantage of dropDuplicatesWithinWatermark over dropDuplicates(['id'])?
5In a streaming SCD2 upsert via foreachBatch + MERGE INTO, how many open (valid_to IS NULL) rows should exist per natural key?
6Why is foreachBatch the right tool for a streaming MERGE INTO an Iceberg dimension?
7An SCD2 upsert overwrites the dimension row in place on each change. What have you actually built?
8A 5-minute window [00:00, 00:05) uses a 10-minute watermark on event_ts. Which arriving event FINALIZES that window?