Databricks Data Engineer Professional Question 139
Single answerYou are working on a Delta Lake table named sales_data and need to create a clone of this table for testing purposes. You create a shallow clone and a deep clone of the sales_data table. Which of the following statements about the behavior of shallow and deep clones is correct?
- A
A shallow clone only copies metadata from the source table, while a deep clone copies both metadata and data files.
- B
A shallow clone creates a writable, independent copy of the source table's data, while a deep clone creates a read-only copy.
- C
Both shallow and deep clones are independent of source table changes immediately after creation.
- D
A deep clone requires significantly less storage than a shallow clone because it reuses source table data files.
Show answer and explanation
Correct answer: A
Explanation
Shallow clones in Delta Lake copy only the metadata and reference the source table's data files, making them efficient for scenarios such as testing or experimentation but dependent on the source table's data. Deep clones, on the other hand, create independent copies by copying both the metadata and data files, which requires more storage but ensures the clone is unaffected by changes to the source table.
- A. Correct.
Correct: A shallow clone copies only the metadata from the source table and references the underlying data files, whereas a deep clone copies both the metadata and the data files, creating a fully independent table.
- B. Incorrect.
Incorrect: A shallow clone does not create a writable, independent copy of data; it references the source table's data files. A deep clone, however, does create a fully independent copy, which is writable.
- C. Incorrect.
Incorrect: While deep clones are immediately independent of the source table, shallow clones depend on the source table's data files and reflect changes to those files unless they are deleted.
- D. Incorrect.
Incorrect: A deep clone requires more storage than a shallow clone because it creates physical copies of the data files, while the shallow clone reuses data files, consuming minimal additional storage.