Databricks Machine Learning Professional Question 14
Select 3A data science team is using a Delta table to store their machine learning dataset. They recently ran an update operation on this Delta table, but realized it introduced errors in the data. The team wants to revert to a previous version of the Delta table to fix the issue. Which of the following steps should they take to achieve this?
- A
Use the
DESCRIBE HISTORYcommand to view the Delta table’s version history and identify the appropriate version to restore. - B
Load the previous version of the Delta table by specifying the version number in the
FORMATclause of theSELECTstatement. - C
Load the previous version of the Delta table by specifying the version number in the
AS OF VERSIONclause of theTABLEfunction. - D
Use the
RESTORE TABLEcommand to directly restore the Delta table to a previous version. - E
Use the
TIME TRAVELfeature by specifying a timestamp to query the Delta table as it existed at that point in time.
Show answer and explanation
Correct answers: A, C, E
Explanation
To revert to a previous version of a Delta table, the team should first use the DESCRIBE HISTORY command to view the table's version history and identify the appropriate version. Then, they can use the AS OF VERSION clause in the TABLE function or leverage the TIME TRAVEL feature by specifying a timestamp to query the desired version of the table. These methods are standard practices for managing Delta tables and utilizing their versioning capabilities.
- A. Correct.
Correct: The
DESCRIBE HISTORYcommand allows users to view the history of operations performed on a Delta table, including version numbers and timestamps, which are necessary to identify the appropriate version to restore. - B. Incorrect.
Incorrect: There is no
FORMATclause in theSELECTstatement to specify a version for Delta tables. This option is invalid. - C. Correct.
Correct: The
AS OF VERSIONclause in theTABLEfunction enables users to query a specific version of a Delta table by providing the version number. - D. Incorrect.
Incorrect: The
RESTORE TABLEcommand is not a valid command in Delta Lake for reverting to a previous version of a Delta table. - E. Correct.
Correct: The
TIME TRAVELfeature allows querying a Delta table as it existed at a specific point in time by specifying a timestamp or version number.