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?

Answer options
Question 3 of 25

Question breakdown

Tests
Configure Structured Streaming triggers
Difficulty
Easy

Key idea: trigger(processingTime="5 seconds") runs micro-batches on a fixed 5-second schedule.

How to reach the answer

  1. The deciding clues are 'micro-batches' and 'fixed interval of 5 seconds'.
  2. processingTime is the trigger type that schedules micro-batches at a fixed interval.
  3. continuous is a different, non-micro-batch execution mode, and its interval is a checkpoint interval.
  4. 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

  • ACorrect. A processingTime trigger launches micro-batches every 5 seconds, or right away if the previous batch overran the interval.
  • BIncorrect. A continuous trigger switches to continuous processing mode, and its 5-second value controls checkpointing rather than batch timing.
  • CIncorrect. trigger(once=True) processes the available data in one batch and then terminates the query.
  • DIncorrect. With no trigger set, micro-batches run back to back with no fixed interval.

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.

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.

Start the free practice test

More questions

Other CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice questions

Scroll to Top