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.
Question breakdown
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
- The clue is the requirement to recover from failures or shutdowns by continuing where the pipeline left off, which describes checkpointing.
- Checkpointing stores the offsets and state of a streaming query in a checkpoint directory.
- The query is created when writeStream...start() is called, so checkpointLocation is set on the writer side.
- recoveryLocation is not a valid Spark option, which rules out B and C.
- That leaves D: set checkpointLocation on writeStream.
Each option
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.
Official documentation: Structured Streaming checkpoints (Databricks)
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 344 of 55. A data engineer is working on a real-time analytics pipeline using Spark Struct…
- 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 11Given a DataFrame df that has 10 partitions, after running the code: result = df.coalesce…
