Databricks Data Engineer Associate Question 302
Single answerYou are working on a Delta Lake table in Databricks that has undergone multiple delete operations. To reclaim storage space, you decide to run the VACUUM command. What happens when you run VACUUM on the table?
- A
VACUUM removes files that are no longer referenced by the Delta table's transaction log.
- B
VACUUM deletes active data files that are currently in use by the Delta table.
- C
VACUUM commits the removal of deleted files only after the retention period has expired.
- D
VACUUM forces an immediate physical deletion of all historical data files, regardless of the retention period.
Show answer and explanation
Correct answer: A
Explanation
The VACUUM command in Delta Lake removes files that are no longer referenced by the transaction log, reclaiming storage. These files are typically old versions of data or data files that were deleted in previous operations. VACUUM ensures that only unreferenced files beyond the retention threshold are physically deleted.
- A. Correct.
Correct. VACUUM in Delta Lake reclaims storage by removing files that are no longer referenced by the transaction log, ensuring they are not needed for future table operations.
- B. Incorrect.
Incorrect. VACUUM does not delete active data files. It only removes files that have been marked as no longer needed by the Delta table's transaction log.
- C. Incorrect.
Incorrect. VACUUM does not involve a retention period for committing deletes. It removes files that are already unreferenced after the specified retention period has passed.
- D. Incorrect.
Incorrect. VACUUM respects the default or user-specified retention period and does not immediately delete all historical data files.