Skip to content
Gold 7 min read · Operations 2 practice problems ↓

Restarts, query changes and reprocessing

Which changes a checkpoint accepts, how to rebuild a stateful query safely, and source schema changes.

Step 4 · Structured Streaming · Gold · Running streams in production, lesson 3 of 3

Read first: Checkpoints and state stores (skip if you know it)

In plain words first

A video game save file lets you stop and continue later. A small game update, such as new graphics, still loads your old save. A big one that changes the rules, such as a new scoring system, may refuse it, because the save was written for the old rules. Then you start a new game, and you play it alongside the old one until it has caught up.

A checkpointcheckpoint: In streaming, the folder where Spark records which input it has processed and its state, so a restarted query continues where it stopped. Learn more → is a stream's save file. Small code changes load it fine; changes to what the stream remembers (its grouping, its keys) do not, and need a new checkpoint, built alongside the running stream.

Unlock the full lesson

You have read the free part. The rest of this advanced lesson:

  • A restart continues, exactly
  • Which changes a checkpoint accepts
  • Reprocessing: new checkpoint, planned start
  • When the source schema changes
  • Try it yourself
  • Common mistakes
  • Key takeaways
  • Interview prep with 3 follow-up questions
  • Check yourself: 3 questions

Unlock it with the Complete pass (every advanced problem and lesson) or on its own.

Practise this

Interview problems on streaming, graded on hidden tests

Keep going

Up next · new module: Kafka in production · 7 min read
Kafka in production
Replication, min.insync.replicas and acks=all, choosing a partition count, compacted topics, and transactions with read_committed.

Related lessons

Previous: Backpressure and rate limits

Primary sources: Recovery semantics after changes in a streaming query · Delta table streaming reads and writes