Databricks Certified Data Engineer Professional Practice Questions

Databricks Certified Data Engineer Professional exam preparation

Databricks Certified Data Engineer Professional practice questions in English: 178 questions with explanations. The mock exam has 60 questions and 120 minutes.

Databricks Certified Data Engineer Professional free question 5 / 10 · Domain 5: Cost & Performance Optimization

To cut storage cost you set delta.deletedFileRetentionDuration = '2 days' on a managed table and enabled predictive optimization. When predictive optimization runs VACUUM, how are the data files that are no longer referenced treated?

  1. They are not deleted; a table whose retention period was changed in a table property drops out of the scope of the predictive optimization VACUUM
  2. They are deleted once 2 days have passed; the VACUUM of predictive optimization uses the retention period of the table property as it is
  3. They are kept for 30 days; the VACUUM of predictive optimization uses a fixed retention period of 30 days regardless of the table property
  4. They are kept for at least 7 days, not 2; the VACUUM of predictive optimization sets a 7-day floor even if the table property is below 7 days
Show the answer and explanation

Answer: D

Why this is correct
The retention window for VACUUM is determined by the table property delta.deletedFileRetentionDuration, which defaults to 7 days. However, if you set this property to less than 7 days, predictive optimization still retains data files for a minimum of 7 days when it runs VACUUM (the page words it as VACUUM FULL). This minimum prevents data loss and preserves recent time travel for the table, so the goal of lowering storage cost with a 2-day setting is not achieved by the predictive optimization VACUUM.

Why the other options are wrong
"They are deleted once 2 days have passed; the VACUUM of predictive optimization uses the retention period of the table property as it is" … A value of 7 days or more is used as it is, but for a value below 7 days the 7-day minimum applies. After 2 days the files are not yet deleted.
"They are kept for 30 days; the VACUUM of predictive optimization uses a fixed retention period of 30 days regardless of the table property" … The VACUUM of predictive optimization also follows the retention period of the table property. 30 days is only an example of a value you might set when you want to keep data longer, not a fixed period.
"They are not deleted; a table whose retention period was changed in a table property drops out of the scope of the predictive optimization VACUUM" … Changing the retention period in a table property does not take a table out of the scope of predictive optimization VACUUM. A value below 7 days is raised to 7 days, and unreferenced files older than that are deleted.

Key point
For a table where you want long time travel, extend delta.deletedFileRetentionDuration with ALTER TABLE ... SET TBLPROPERTIES before you enable predictive optimization. If you extend it after enabling, old files may already have been deleted.

Go to the Databricks Certified Data Engineer Professional practice app (10 free questions; purchase unlocks all questions)

See the full practice set