New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Certified Associate Developer for Apache Spark 3.5 Exam - Topic 3 Question 7 Discussion

Actual exam question for Databricks's Databricks Certified Associate Developer for Apache Spark 3.5 exam
Question #: 7
Topic #: 3
[All Databricks Certified Associate Developer for Apache Spark 3.5 Questions]

44 of 55. A data engineer is working on a real-time analytics pipeline using Spark Structured Streaming. They want the system to process incoming data in micro-batches at a fixed interval of 5 seconds.

Which code snippet fulfills this requirement?

A.

query = df.writeStream \

.outputMode("append") \

.trigger(processingTime="5 seconds") \

.start()

B.

query = df.writeStream \

.outputMode("append") \

.trigger(continuous="5 seconds") \

.start()

C.

query = df.writeStream \

.outputMode("append") \

.trigger(once=True) \

.start()

D.

query = df.writeStream \

.outputMode("append") \

.start()

Show Suggested Answer Hide Answer
Suggested Answer: A

To process data in fixed micro-batch intervals, use the .trigger(processingTime='interval') option in Structured Streaming.

Correct usage:

query = df.writeStream

.outputMode('append')

.trigger(processingTime='5 seconds')

.start()

This instructs Spark to process available data every 5 seconds.

Why the other options are incorrect:

B: continuous triggers are for continuous processing mode (different execution model).

C: once=True runs the stream a single time (batch mode).

D: Default trigger runs as fast as possible, not fixed intervals.


PySpark Structured Streaming Guide --- Trigger types: processingTime, once, continuous.

Databricks Exam Guide (June 2025): Section ''Structured Streaming'' --- controlling streaming triggers and batch intervals.

===========

Contribute your Thoughts:

0/2000 characters
Pearly
9 hours ago
Option A is definitely the right choice!
upvoted 0 times
...
Chan
6 days ago
Wait, is this a trick question? I'm going with Option D just to be safe.
upvoted 0 times
...
Julian
11 days ago
Option B is the way to go, no doubt about it.
upvoted 0 times
...
Tarra
16 days ago
Hmm, I'm torn between Option A and Option B. Tough choice!
upvoted 0 times
...
Reuben
21 days ago
Option D seems a bit too simple, I'm going with Option A.
upvoted 0 times
...
Pamella
26 days ago
Option C is clearly the way to go here.
upvoted 0 times
...
Glory
1 month ago
I think Option B is the correct answer.
upvoted 0 times
...
Joanna
1 month ago
Option A looks good to me.
upvoted 0 times
...
Leota
1 month ago
Option D seems incomplete since it doesn't specify a trigger, which I think is necessary for setting the interval. I lean towards A as well.
upvoted 0 times
...
Tamra
2 months ago
I practiced a similar question, and I recall that `once=True` is used for one-time queries, which wouldn’t work here. So, I think C is definitely wrong.
upvoted 0 times
...
Amie
2 months ago
I'm leaning towards Option A as well. The question is specifically asking for a fixed 5-second interval, and Option A seems to address that requirement directly. The other options don't seem to match the problem statement as closely.
upvoted 0 times
...
Brittani
2 months ago
Based on my understanding, the `trigger(continuous="5 seconds")` option in Option B is used for continuous processing, which is different from the micro-batch processing that the question is asking for. So I think Option A is the better choice here.
upvoted 0 times
...
Eugene
2 months ago
I'm not entirely sure, but I think `continuous` is for continuous processing, which doesn't fit the micro-batch requirement. So, maybe it's not B?
upvoted 0 times
...
Glenna
2 months ago
I remember that for micro-batch processing, we typically use the `processingTime` trigger, so I think Option A is the right choice.
upvoted 0 times
...
Wilbert
2 months ago
I think Option A is the right choice. It specifies processing time.
upvoted 0 times
...
Tricia
3 months ago
Hmm, I'm a bit confused. Option B also mentions a 5-second interval, but it uses the `trigger(continuous="5 seconds")` parameter instead. I'm not sure what the difference is between those two options.
upvoted 0 times
...
Lavonda
3 months ago
I think Option A looks like the right choice here. The question specifically asks for a 5-second micro-batch processing interval, and Option A uses the `trigger(processingTime="5 seconds")` parameter to fulfill that requirement.
upvoted 0 times
Delsie
3 months ago
Yeah, the 5 seconds micro-batch is key here.
upvoted 0 times
...
Kiley
3 months ago
Option B is misleading with continuous processing.
upvoted 0 times
...
...

Save Cancel