Configure Spark Structured Streaming checkpoint recovery and exactly-once processing guarantees

domain: dataeng-general · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Set checkpointLocation in the writeStream options to a reliable, durable path (HDFS, S3, ADLS) before starting the stream
  2. Use a sink that supports idempotent writes or two-phase commit (e.g., Delta Lake, Kafka with transactions) to achieve end-to-end exactly-once semantics
  3. Stop and restart the streaming query without changing the checkpointLocation; verify in the logs that the query resumes from the last committed offset
  4. Simulate a failure by killing the query mid-batch and restarting; confirm that no duplicate records appear in the output and no records are skipped
  5. Validate that changing the query's transformations (e.g., adding a column) is compatible with the existing checkpoint; incompatible changes require a fresh checkpoint and potential data replay

Known gotchas

Related routes

Configure checkpointing and recovery in Spark Structured Streaming
data-engineering · 5 steps · unrated
Configure Spark Structured Streaming trigger modes (processingTime, availableNow, continuous)
data-engineering · 5 steps · unrated
Configure Spark Structured Streaming watermarking to handle late-arriving data and bound state size
spark.apache.org · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans