Databricks-DE-Assoc Troubleshooting, Monitoring, and Optimization Practice Question
Which Databricks command should you use to recover storage space by removing files that are no longer referenced by a Delta table and are older than the retention period?
⚠ Common exam trap
Candidates confuse OPTIMIZE with VACUUM, incorrectly believing compaction removes old historical data files when only VACUUM handles data retention removal.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
VACUUM table_name RETAIN 30 DAYS;
VACUUM is the standard tool for cleaning up orphan files in Delta Lake. Because Delta Lake uses versioning, old files are kept for 'Time Travel' functionality until specifically vacuumed. Managing this storage is essential for cost control and compliance with data retention policies. Engineers must understand that once VACUUM is run, the history of the table is permanently pruned, making point-in-time recovery to those older versions impossible.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
DELETE FROM table_name WHERE date < current_date() - 30;
Why it's wrong here
This command removes data from the table log and marks it as deleted in the Delta metadata, but it does not physically remove the underlying Parquet files from cloud storage. The storage space remains occupied until a vacuum operation is executed to garbage collect the files.
- ✗
TRUNCATE TABLE table_name;
Why it's wrong here
TRUNCATE removes all data from the table but does not necessarily reclaim the physical storage space in the cloud provider's storage layer immediately. It leaves the underlying directory structure and potentially some data files behind, requiring a vacuum operation to perform final cleanup and reclamation of space.
- ✓
VACUUM table_name RETAIN 30 DAYS;
Why this is correct
VACUUM is the specific command used to delete data files that are no longer part of the Delta table's current state and are older than the specified retention threshold. This operation is necessary to reclaim storage space in cloud object storage and maintain compliance with data management policies.
- ✗
DROP TABLE table_name;
Why it's wrong here
Dropping a table removes the entry from the metastore, but depending on the configuration and storage type, it may not automatically delete the underlying data files in S3 or ADLS. Relying on DROP TABLE for space management is unreliable and does not provide granular control over file retention.
About these practice questions
Courseiva writes every Databricks-DE-Assoc question from scratch — 276 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-DE-Assoc practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-DE-Assoc exam.