Databricks Data Engineer Associate Question 270
Single answerYou are working with a Delta table in Databricks, and you need to identify the users who have made changes to the table in previous versions. Which command or approach should you use?
- A
Use the DESCRIBE HISTORY command to view the table's history and identify the users who made changes.
- B
Query the Delta table directly using a SELECT statement with a WHERE clause on the _user column.
- C
Use the SHOW USERS command to list all users who interacted with the Delta table.
- D
Check the Databricks audit logs for user activity on the Delta table.
Show answer and explanation
Correct answer: A
Explanation
The DESCRIBE HISTORY command is a built-in feature of Delta Lake that allows users to view the version history of a table, including metadata such as the user who performed each operation. This makes it the most efficient and direct way to identify who has written previous versions of a Delta table.
- A. Correct.
The DESCRIBE HISTORY command provides metadata about the Delta table, including information about previous versions, such as the operation, timestamp, and the user who made changes. This is the correct approach.
- B. Incorrect.
Delta tables do not inherently store a _user column for querying user information. This option is incorrect.
- C. Incorrect.
SHOW USERS is not a valid Databricks or Delta Lake command and cannot be used to identify users who interacted with a Delta table. This option is incorrect.
- D. Incorrect.
While audit logs can provide detailed user activity, they are not specific to Delta table version history and require additional setup to use. This makes it an indirect and less efficient solution for this scenario.