Databricks Data Engineer Associate Question 299
Single answerYou are managing a Delta Lake table in a Databricks environment. You run the VACUUM command to clean up files that are no longer in use. However, you notice that certain files are not being deleted even though they are no longer referenced. What could be the most likely reason for this behavior?
- A
The retention period for deleted files has not expired.
- B
The Delta table does not support the VACUUM operation.
- C
The Delta table is being actively queried by another process.
- D
The VACUUM command was executed without specifying a retention period.
Show answer and explanation
Correct answer: A
Explanation
The VACUUM command in Delta Lake is used to delete old data files that are no longer referenced by the table. However, Delta Lake enforces a default retention period of 7 days to ensure that any recent changes, such as updates or deletes, are not inadvertently lost. If the retention period has not expired, the VACUUM command will not delete files, even if they are no longer referenced by the Delta table.
- A. Correct.
The VACUUM command in Delta Lake only deletes files that are older than the default retention period (7 days) unless explicitly overridden. If the retention period has not expired, files will not be deleted.
- B. Incorrect.
Delta tables do support the VACUUM operation, so this is not a correct explanation for the observed behavior.
- C. Incorrect.
While active queries on the table may temporarily lock certain files, they do not prevent the VACUUM command from identifying files for deletion based on the retention period.
- D. Incorrect.
If no retention period is specified, the default retention period of 7 days is applied. This does not cause the VACUUM command to fail but ensures it follows the default retention rules.