CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice question 3 of 25
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…
Choose your answer, then check it against the explanation and the full breakdown below.
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?
Question breakdown
Key idea: trigger(processingTime="5 seconds") runs micro-batches on a fixed 5-second schedule.
How to reach the answer
- The deciding clues are 'micro-batches' and 'fixed interval of 5 seconds'.
- processingTime is the trigger type that schedules micro-batches at a fixed interval.
- continuous is a different, non-micro-batch execution mode, and its interval is a checkpoint interval.
- once=True runs a single batch and stops, and leaving out the trigger starts each batch as soon as the previous one finishes.
Each option
Common trap: Option B also contains "5 seconds", so it looks equivalent, but the continuous trigger is not micro-batch execution and the interval means something different.
In practice: Fixed processingTime intervals are used to control cost and batch sizes for sinks such as Delta tables. availableNow is the usual choice for scheduled incremental runs.
Remember: Use processingTime for fixed-interval micro-batches, continuous for low-latency non-batch mode, and once or availableNow for one-off runs.
Official documentation: Configure Structured Streaming trigger intervals
Drafted with AI assistance and checked against the answer key.
Keep practicing
Take the free CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice questions
- Question 1You have: DataFrame A: 128 GB of transactions DataFrame B: 1 GB user lookup table Which s…
- Question 2A Spark DataFrame df is cached using the MEMORY_AND_DISK storage level, but the DataFrame…
- Question 7A developer wants to test Spark Connect with an existing Spark application. What are the …
- Question 8A data engineer is running a Spark job to process a dataset of 1 TB stored in distributed…
- Question 10A data engineer is building a Structured Streaming pipeline and wants the pipeline to rec…
- Question 11Given a DataFrame df that has 10 partitions, after running the code: result = df.coalesce…
