Skip to content

A scenario for a data engineer · Junior and up

A small change to a running stream

Patch · Your teammate
Wednesday, 11:40

A Structured Streaming job on Databricks that reads a Delta table needs one more filter. A colleague says the safe way to ship a change is to delete the checkpoint folder and start clean.

What do you do?

Tap the one you would do. The answer opens below.

Show the best call

Keep the checkpoint. Stop the stream, add the filter, and start it again from the same checkpoint.

The stream carries on from where it stopped. Nothing is read twice.

Why

The checkpoint is where a stream records how far it has read. A change such as adding a filter can restart from the same checkpoint. Without the checkpoint the stream starts fresh, and a Delta source is read again from the beginning.

Read it in the Databricks docs (opens in a new tab)

The other two

Works, at a price. Start with a new checkpoint, and set the starting version to the point where the old run stopped.
It works if you get the version exactly right. One off, and rows are skipped or loaded twice.
A poor call. Delete the checkpoint and start clean.
The stream reads the whole source table again and appends all of it a second time.

The words in this scenario

Checkpoint.
The place where a stream records how far it has read and what it is keeping in memory, so that after a stop it carries on from the same point. In the docs (opens in a new tab)

Go deeper on brickster.ai

More scenarios

Had one like this at work? Send it to us: the best tickets come from real incidents.

Checked against the Databricks documentation on . brickster.ai is independent and is not affiliated with Databricks.