Data Preparation for ML and AI

A Spark Structured Streaming job calculates five-minute event-time aggregates; records can arrive up to ten minutes late. The job must incorporate these late records while eventually removing old aggregation state. Which configuration BEST meets these requirements?

Show the answer

Correct answerD. Use event-time windows with a ten-minute watermark.

AWhy not this: Processing-time windows group by arrival processing time, and a trigger controls execution frequency rather than allowed lateness.

BWhy not this: Processing-time grouping does not assign delayed records to their original event-time windows.

CWhy not this: Checkpoints preserve recovery information but do not define when old aggregation state can be removed.

DWhy this is right: An event-time watermark accommodates late records within the threshold and permits cleanup of older window state.

An event-time watermark allows bounded late arrival and enables cleanup of old window state as event time advances. Checkpointing supports recovery but does not establish a lateness policy or bound aggregation state.