Home / DE Associate practice test / Data Transformation and Modeling / Question

Databricks Data Engineer Associate · free practice question

A data engineer sees that a Delta table has accumulated many small files from frequent streaming writes, slowing queries that filter on a high-cardinality…

Exam-style question on Data Transformation and Modeling from the free DE Associate practice test, with the answer and a full explanation below.

Updated November 10, 2026

Data Transformation and Modeling

A data engineer sees that a Delta table has accumulated many small files from frequent streaming writes, slowing queries that filter on a high-cardinality event_id column. They also want to reclaim storage from data files no longer referenced. Which maintenance approach is correct?

  1. ARun VACUUM with ZORDER BY (event_id), which compacts the small files sorted by that column and deletes the stale files in a single pass.
  2. BRun OPTIMIZE with no ZORDER, which compacts and clusters the files across the columns, then let time travel purge old files after retention.
  3. CSet delta.autoOptimize and delta.autoCompact, then issue ZORDER BY (event_id) as a standalone command; compaction deletes the old small files.
  4. DRun OPTIMIZE with ZORDER BY (event_id) to compact files and co-locate data by event_id, then run VACUUM to remove unreferenced files past retention.
  5. ERun OPTIMIZE ZORDER BY (event_id), then VACUUM RETAIN 0 HOURS on a schedule, the recommended default with no effect on readers or time travel.
Answer & explanation

Correct answer: D

WHY D: OPTIMIZE compacts small files and ZORDER BY co-locates data on event_id to speed filtered reads, and VACUUM then removes files older than the retention period that the transaction log no longer references.

WHY NOT A: VACUUM only deletes old files; it does not compact and does not accept a ZORDER clause.

WHY NOT B: OPTIMIZE without ZORDER does not cluster on the columns, and time travel does not purge files; VACUUM does.

WHY NOT C: ZORDER is not a standalone command (it is an OPTIMIZE clause), and compaction does not delete the old files when it rewrites them, so VACUUM is still needed.

WHY NOT E: VACUUM RETAIN 0 HOURS breaks time travel and can corrupt in-flight readers; it is not a recommended default.

Take the full DE Associate practice test free →

Would you pass today?

This question is one of 45 in the free, timed Databricks Data Engineer Associate practice test. Take it and get a section-by-section score.

Start the free test →