Skip to content

A scenario for a data engineer · Mid level and up

You need to test a risky change

Chief · Your manager
Tuesday, 13:30

You rewrote the logic that updates a 600 gigabyte orders table in Delta. You want to try it on real data in your Databricks workspace before it touches production.

What do you do?

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

Show the best call

Make a shallow clone of the table in a dev schema and run the new logic against the clone.

The clone is ready in seconds and copies no data. Your test writes go to the clone only.

Why

A shallow clone is a new table that points at the source table's data files instead of copying them. Changes to the clone go to its own files and never touch the source. A deep clone copies the data as well.

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

The other two

Works, at a price. Copy the whole table into a dev schema and test on the copy.
A safe test, after a long copy, and you pay to store 600 gigabytes twice.
A poor call. Run it on the production table at a quiet hour, with RESTORE ready.
The night loads wrote to the table after your change. Restoring now would undo their work too.

The words in this scenario

Clone.
A copy of a Delta table. A shallow clone copies only the table's metadata and points at the source's data files; a deep clone copies the data too. In the docs (opens in a new tab)
RESTORE and table history.
A Delta table keeps a history of its versions. A query can read an earlier version, and RESTORE puts the table back to one. 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.