A junior data engineer has been asked to develop a streaming data pipeline with a grouped aggregation using DataFrame df. The pipeline needs to calculate the average humidity and average temperature for each non-overlapping five-minute interval. Events are recorded once per minute per device. Streaming DataFrame df has the following schema: "device_id INT, event_time TIMESTAMP, temp FLOAT, humidity FLOAT" Code block: Which line of code correctly fills in the blank within the code block to complete this task?

- Ato_interval("event_time", "5 minutes").alias("time")
- Bwindow("event_time", "5 minutes").alias("time") (correct answer)
- C"event_time"
- Dlag("event_time", "10 minutes").alias("time")
Reveal answer & explanationHide answer
The correct answer is B. Option B: window("event_time", "5 minutes").alias("time") This option meets the real-time / low-latency performance requirement.





