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 Associate Developer for Apache Spark 3.5 Exam - Topic 3 Question 7 Discussion

Posted by Teresita on Nov 19, 2025 at 04:40 AM

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()

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.

===========

Get Premium Databricks Certified Associate Developer for Apache Spark 3.5 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
31 comments · newest first
JO
Jodi 6 months ago
D lacks the trigger. It won't process at intervals.
TA
Tabetha 6 months ago
C is definitely not it. Once means no continuous processing.
ZI
Zita 6 months ago
I feel confident about A too. It matches the requirement.
LA
Laura 6 months ago
Option B seems wrong. Continuous isn't for micro-batches.
MA
Magdalene 6 months ago
Agreed! 5 seconds is perfect for micro-batches.
FL
Fletcher 6 months ago
Is it really just 5 seconds? Seems too short for some use cases.
AN
An 7 months ago
Wow, I didn't know about the "trigger" options!
HO
Holley 7 months ago
Option C won't work for micro-batches, right?
CA
Cathrine 7 months ago
I think Option B is better for continuous processing.
PE
Pearly 8 months ago
Option A is definitely the right choice!
CH
Chan 8 months ago
Wait, is this a trick question? I'm going with Option D just to be safe.
JU
Julian 8 months ago
Option B is the way to go, no doubt about it.
TA
Tarra 8 months ago
Hmm, I'm torn between Option A and Option B. Tough choice!
RE
Reuben 8 months ago
Option D seems a bit too simple, I'm going with Option A.
PA
Pamella 8 months ago
Option C is clearly the way to go here.
GL
Glory 9 months ago
I think Option B is the correct answer.
JO
Joanna 9 months ago
Option A looks good to me.
LE
Leota 9 months 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.
TA
Tamra 9 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.
AM
Amie 9 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.
BR
Brittani 9 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.
EU
Eugene 10 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?
GL
Glenna 10 months ago
I remember that for micro-batch processing, we typically use the `processingTime` trigger, so I think Option A is the right choice.
WI
Wilbert 10 months ago
I think Option A is the right choice. It specifies processing time.
TR
Tricia 11 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.
LA
Lavonda 11 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.
NA
Nan 5 months ago
↳ replying to Lavonda
Good catch! A is the clear winner.
MA
Maddie 5 months ago
↳ replying to Lavonda
Exactly, A is the only one that matches the requirement.
AR
Aretha 5 months ago
↳ replying to Lavonda
I agree, Option A is definitely the right choice.
DE
Delsie 10 months ago
↳ replying to Lavonda
Yeah, the 5 seconds micro-batch is key here.
KI
Kiley 10 months ago
↳ replying to Lavonda
Option B is misleading with continuous processing.
0/2000 characters

Save Cancel