CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK-3-5-QUESTIONS practice question 10 of 25

A data engineer is building a Structured Streaming pipeline and wants the pipeline to recover from failures or intentional shutdowns by continuing…

Choose your answer, then check it against the explanation and the full breakdown below.

A data engineer is building a Structured Streaming pipeline and wants the pipeline to recover from failures or intentional shutdowns by continuing where the pipeline left off. How can this be achieved?
Answer options
Question 10 of 25

Question breakdown

Tests
Configure fault tolerance in Structured Streaming with checkpointing
Difficulty
Easy

Key idea: A streaming query records its offsets and state in a checkpoint directory, which you set with the checkpointLocation option on the DataStreamWriter so a restarted query resumes where it stopped.

How to reach the answer

  1. The clue is the requirement to recover from failures or shutdowns by continuing where the pipeline left off, which describes checkpointing.
  2. Checkpointing stores the offsets and state of a streaming query in a checkpoint directory.
  3. The query is created when writeStream...start() is called, so checkpointLocation is set on the writer side.
  4. recoveryLocation is not a valid Spark option, which rules out B and C.
  5. That leaves D: set checkpointLocation on writeStream.

Each option

  • AIncorrect. checkpointLocation belongs to the DataStreamWriter (the query and sink side), not to the DataStreamReader source configuration.
  • BIncorrect. recoveryLocation is not a real option, and recovery is configured per query rather than at SparkSession initialization.
  • CIncorrect. writeStream is the right place, but the option is named checkpointLocation, not recoveryLocation.
  • DCorrect. Setting checkpointLocation on writeStream persists offsets and state so a restarted query resumes from its last committed progress.

Common trap: Option A is tempting because it sounds logical that the reader would track how far it has read from the source, but Spark tracks progress for the whole query on the writer side.

In practice: Every production streaming job, such as Kafka or Auto Loader into Delta, needs a unique, durable checkpoint path per query. Deleting or sharing that path causes reprocessing or corrupted state.

Remember: Fault-tolerant streaming means using .option("checkpointLocation", path) on writeStream, with one dedicated path per query.

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