DP-700 practice question 2 of 25

You need to recommend a solution for handling old files. The solution must meet the technical requirements. What should you include in the recommendation?

Full set: 129 questions
Answer options
A: a data pipeline that includes a Copy data activity
B: a notebook that runs the VACUUM command Correct answer
C: a notebook that runs the OPTIMIZE command
D: a data pipeline that includes a Delete data activity
Correct Answer:
B. a notebook that runs the VACUUM command
Explanation

The VACUUM command is specifically designed to clean up and remove old, unreferenced data files from the underlying storage of a Delta Lake table. When data in a Delta Lake table is updated or deleted, the old data files are not immediately removed to support features like time travel. The VACUUM command purges these stale files that are older than the specified retention threshold, which directly addresses the requirement of handling old files in a safe, transactionally-aware manner. This is a crucial table maintenance task for managing storage costs and cleaning up data.

Why Incorrect

A. A Copy data activity is used for data movement and transformation. It does not have a built-in function to identify and remove old, unreferenced files from a source table.
C. The OPTIMIZE command is used for performance tuning by compacting many small files into fewer, larger files. It reorganizes existing data but does not delete old versions.
D. A Delete data activity performs a physical deletion of files or folders. Using it on a Delta Lake table is dangerous as it bypasses the transaction log, risking table corruption.

References

1. Microsoft Learn, Azure Synapse Analytics Documentation. "Use VACUUM on a Delta Lake table". This document states, "Recursively vacuum directories associated with the Delta table and remove data files that are no longer in the latest state of the transaction log for the table and are older than a retention threshold."

2. Delta Lake Documentation. "Table utility commands - vacuum". Section: vacuum. The official documentation specifies, "Remove files from the table that are no longer referenced by a Delta table and are older than the retention threshold."

3. Microsoft Learn, Azure Synapse Analytics Documentation. "What is Delta Lake?". Section: "Time travel". This document explains that Delta Lake maintains historical versions of data, which necessitates a mechanism like VACUUM to eventually remove old, unneeded file versions.

Scroll to Top