An analyst ran an UPDATE an hour ago that set every row's status to 'shipped' in the Delta table sales.orders. DESCRIBE HISTORY shows that version 41 is the last version before that update. The data engineer must return the table to its state at version 41. Which command does that?
Choose one.
RESTORE returns a Delta table to an earlier version.
Delta keeps prior versions in the transaction log. DESCRIBE HISTORY lists them, VERSION AS OF and TIMESTAMP AS OF read them, and RESTORE TABLE ... TO VERSION AS OF (or TO TIMESTAMP AS OF) makes the current table match one of them by adding a new commit. Reading an old version or cloning it into a new table leaves sales.orders unchanged, and VACUUM only removes files.
- Note the goal: change the current table, not just read history or copy it.
- Recall the commands that read history (SELECT ... VERSION AS OF) or copy it (CLONE ... VERSION AS OF) vs change it (RESTORE).
- Reject VACUUM, which only removes files.
- Choose RESTORE TABLE ... TO VERSION AS OF 41.
Exam tip: Read the past with VERSION AS OF; go back to it with RESTORE.
Databricks Platform Architecture, Delta Lake, Unity Catalog and Compute (Data Engineer Associate) — the lesson that teaches this.