Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Certified Data Engineer Professional Exam - Topic 1 Question 51 Discussion

Posted by Lajuana on Jun 21, 2026 at 06:42 AM

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:

Choose the response that correctly fills in the blank within the code block to complete this task.

Suggested Answer: B

This is the correct answer because the window function is used to group streaming data by time intervals. The window function takes two arguments: a time column and a window duration. The window duration specifies how long each window is, and must be a multiple of 1 second. In this case, the window duration is ''5 minutes'', which means each window will cover a non-overlapping five-minute interval. The window function also returns a struct column with two fields: start and end, which represent the start and end time of each window. The alias function is used to rename the struct column as ''time''. Verified Reference: [Databricks Certified Data Engineer Professional], under ''Structured Streaming'' section;Databricks Documentation, under ''WINDOW'' section. https://www.databricks.com/blog/2017/05/08/event-time-aggregation-watermarking-apache-sparks-structured-streaming.html


Get Premium Databricks Certified Data Engineer Professional Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
12 comments · newest first
KE
Kenny 2 months ago
Option A could work too, but it’s not as clear for grouping.
FE
Felicitas 2 months ago
I agree, B makes sense. We need non-overlapping intervals.
AN
An 3 months ago
I think option B is the best choice. It groups by 5-minute windows.
CR
Cristal 3 months ago
I’m surprised this is even a question; B is pretty obvious!
JO
Johanna 3 months ago
Wait, why would you use lag? That doesn’t make sense here.
TH
Theola 3 months ago
No way, D is too long for non-overlapping intervals!
TI
Timothy 3 months ago
I think A could work too, but not for this specific case.
HA
Hana 3 months ago
Definitely B! That’s the right way to group by time intervals.
EL
Ellsworth 4 months ago
I’m confused about the difference between "window" and "to_interval." I hope I remember the right one for this exam!
CR
Cristy 4 months ago
I think we did a question with a similar schema, and I chose the window function then too. It seems like the best option for aggregating over time.
LE
Lettie 4 months ago
I'm not entirely sure, but I feel like using "to_interval" might be more appropriate for this specific case.
BE
Beckie 4 months ago
I remember we practiced something similar where we had to group data by time intervals. I think the window function is the right approach here.
0/2000 characters

Save Cancel