Databricks Data Engineer Associate Question 286
Single answerYou are managing a Delta table in Databricks, and an incorrect update was applied to the table. The team has requested that you roll back the table to a previous state. Which action should you take to achieve this?
- A
Use the RESTORE command to specify the desired table version.
- B
Query the Delta table's history and use the DESCRIBE command to revert to a previous version.
- C
Use the Time Travel feature to query a previous version and overwrite the current table.
- D
Delete the current version of the table and manually recreate it using a backup.
Show answer and explanation
Correct answer: C
Explanation
Delta Lake's Time Travel feature enables you to access previous versions of a table. By querying a specific version or timestamp and overwriting the current table, you can effectively roll back to an earlier state. This is the recommended approach for handling incorrect updates or accidental data modifications.
- A. Incorrect.
The RESTORE command is not available in Delta Lake; instead, Time Travel is used to access previous table versions.
- B. Incorrect.
The DESCRIBE command is used to retrieve metadata about a table, not to roll back a table to a previous version.
- C. Correct.
Delta Lake's Time Travel feature allows you to query a previous version of a table using a specific version number or timestamp. You can then overwrite the current table with the data from the desired version to effectively roll it back.
- D. Incorrect.
Manually recreating a table is not an efficient or recommended method since Delta Lake provides built-in features for versioning and rollback.