Databricks Data Engineer Associate Question 269
Single answerYou are working with a Delta table in Databricks, and your team wants to identify which users have made changes to previous versions of the table. Which command would you use to retrieve the user information for those changes?
- A
DESCRIBE HISTORY <table_name>
- B
SELECT * FROM <table_name>
- C
SHOW USERS OF <table_name>
- D
OPTIMIZE <table_name>
Show answer and explanation
Correct answer: A
Explanation
To identify who made changes to previous versions of a Delta table, you need to use the DESCRIBE HISTORY command. This command provides a transaction log that includes details about each change, such as the timestamp, operation type, and the user who performed the operation. Other options do not provide this level of metadata or are unrelated to the task.
- A. Correct.
The
DESCRIBE HISTORYcommand provides a detailed history of operations on a Delta table, including the user who performed each operation, making it the correct choice for identifying who made changes to previous versions of the table. - B. Incorrect.
The
SELECTstatement retrieves data from a table but does not provide any metadata or historical information about table modifications. - C. Incorrect.
The
SHOW USERScommand does not exist in Databricks. This is an invalid option. - D. Incorrect.
The
OPTIMIZEcommand is used to compact files in a Delta table to improve query performance. It does not retrieve historical metadata or user information.