Databricks Data Engineer Associate Question 298
Single answerIn a Delta Lake table, what happens when the VACUUM operation is performed, and how does it commit deletes?
- A
The VACUUM operation physically deletes files marked for deletion after the retention period has passed.
- B
The VACUUM operation immediately deletes all files marked for deletion, regardless of the retention period.
- C
The VACUUM operation only removes stale metadata references without deleting physical files.
- D
The VACUUM operation requires a checkpoint to be created before committing deletes.
Show answer and explanation
Correct answer: A
Explanation
The VACUUM operation in Delta Lake is used to clean up old files no longer needed by the transaction log. It physically removes these files from storage after the retention period to ensure safe operations and to prevent accidental deletion of files that might be needed for rollback or time travel. The retention period is a critical safeguard in this process.
- A. Correct.
Correct. The VACUUM operation in Delta Lake physically deletes files that were marked for deletion, but only after the configured retention period has passed.
- B. Incorrect.
Incorrect. The VACUUM operation respects the retention period to prevent accidental deletion of data that might still be needed for recovery or time travel.
- C. Incorrect.
Incorrect. The VACUUM operation removes physical files, not just stale metadata references. Stale metadata is managed by Delta Lake's transaction log.
- D. Incorrect.
Incorrect. The VACUUM operation does not require a checkpoint to commit deletes; the operation directly removes the physical files based on the retention period.