Removing Unreferenced Delta Table Files in Fabric

DP-600 Last updated

Short answer

D Run the VACUUM command to remove unreferenced files from the Delta table while maintaining ACID properties.

Question

You have a Fabric tenant that contains a lakehouse named Lakehouse1. Lakehouse1 contains a Delta table that has one million Parquet files. You need to remove files that were NOT referenced by the table during the past 30 days. The solution must ensure that the transaction log remains consistent, and the ACID properties of the table are maintained. What should you do?

  1. From OneLake file explorer, delete the files.
  2. Run the OPTIMIZE command and specify the Z-order parameter.
  3. Run the OPTIMIZE command and specify the V-order parameter.
  4. Run the VACUUM command. Correct Answer

Key Takeaways

The VACUUM command removes files no longer referenced by the Delta transaction log, maintaining ACID consistency, whereas manual deletion breaks the table.

This page explains how to safely remove unreferenced Parquet files from a Delta table in a Microsoft Fabric lakehouse while preserving ACID properties. The correct approach is to run the VACUUM command.

Common mistake: Choosing to delete files manually via OneLake file explorer, which breaks the transaction log and destroys the ACID properties of the Delta table.

Expert Analysis

Why the Answer Is Correct

The VACUUM command recursively removes files from the Delta table directory that are no longer referenced by the table's transaction log and are older than the specified retention threshold. By using VACUUM, you ensure that the transaction log remains consistent and the ACID properties of the Delta table are fully maintained, safely cleaning up stale files like those older than 30 days.

Why the Other Options Are Wrong

Deleting files directly from the OneLake file explorer bypasses the Delta transaction log, which breaks ACID consistency and can lead to corrupted table reads. The OPTIMIZE command, whether using Z-order or V-order parameters, is used for file compaction and performance optimization by merging small files into larger ones, not for removing unreferenced old files.

Community Comment Notes

Commenters correctly pointed out that VACUUM acts like a real vacuum cleaning up dust, as vernillen noted, "Cleanup of dust just lying around". Nefirs provided the official Microsoft Learn documentation link confirming that VACUUM is the proper method to remove files no longer referenced by the current version of the table.

Official Reference

Exam Strategy

When asked to remove old or unreferenced files from a Delta table while maintaining ACID properties, always choose the VACUUM command. Remember that OPTIMIZE is for file compaction and query performance, not for deleting stale data files.

Community Votes

D
100%

100% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 4 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded.

From public community threads 4

  1. Nefirs 👍 10 Answered D
    D: https://learn.microsoft.com/en-us/fabric/data-engineering/lakehouse-table-maintenance
  2. prabhjot 👍 4
    Yes D - To remove files from a Delta table that are no longer referenced by the current version of the table, you should run the VACUUM command.
  3. vernillen 👍 3 Answered D
    Just think of the aspect of a real VACUUM: Cleanup of dust just lying around
  4. stilferx 👍 2 Answered D
    IMHO, D) Vacuum is good

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Practice All DP-600 Questions

Access 115 questions with complete answers and detailed explanations.

View Full DP-600 Practice Test →

← Back to DP-600 Study Guide