46 of 55.
A data engineer is implementing a streaming pipeline with watermarking to handle late-arriving records.
The engineer has written the following code:
inputStream \
.withWatermark("event_time", "10 minutes") \
.groupBy(window("event_time", "15 minutes"))
What happens to data that arrives after the watermark threshold?
Watermarking in Structured Streaming defines how late a record can arrive based on event time before Spark discards it.
Behavior:
.withWatermark('event_time', '10 minutes')
This means Spark will keep state for 10 minutes beyond the maximum event time seen so far.
Any data arriving later than 10 minutes after the current watermark is ignored --- it will not be included in the aggregation or output.
Why the other options are incorrect:
B: Late data beyond the watermark threshold is not included.
C: Late data is not moved to a new window; it's simply dropped.
D: True for late data within the watermark threshold, not after it.
Spark Structured Streaming Guide --- withWatermark() behavior and late data handling.
Databricks Exam Guide (June 2025): Section ''Structured Streaming'' --- watermarking and state cleanup behavior.
===========
Currently there are no comments in this discussion, be the first to comment!