Skip to content

A scenario for a data engineer · Staff and up

Six weeks of wrong totals

Penny · Finance
Monday, 11:00

A bug in the tax logic wrote wrong totals to the Gold sales table, a Delta table, for the last six weeks. The fix is merged. The table is read all day, and the nightly load has to keep running.

What do you do?

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

Show the best call

Recompute the six weeks from Silver and write them as a replace of just that date range, in one write.

Readers see the old rows until the write commits, then the corrected ones. The rest of the table is untouched.

Why

A selective overwrite replaces only the rows that match a condition, as one atomic commit: REPLACE WHERE in SQL, replaceWhere in a DataFrame write. A backfill done this way uses the real pipeline logic and never shows readers a half-finished table.

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

The other two

Works, at a price. Rebuild the whole table from Silver.
Correct in the end. It takes most of a day and rewrites the whole table to fix six weeks.
A poor call. Patch the totals with an UPDATE written by hand.
The numbers look right today. Nobody can show how they were made, and the next audit will ask.

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.