Databricks Data Engineer Professional Question 140
Select 3You are working on a Delta Lake table named 'transactions' and need to create a clone of this table for testing purposes. You decide to create a shallow clone first to verify its structure and size, and then later create a deep clone for isolated testing. Which of the following statements are accurate about the behavior and differences between shallow and deep clones?
- A
Shallow clones do not copy the data files but share the same underlying data as the source table.
- B
Deep clones copy both the metadata and data files from the source table to the target table.
- C
Shallow clones can still function correctly even if the source table is deleted.
- D
Deep clones are created faster than shallow clones because they do not depend on the source table.
- E
Both shallow and deep clones create independent metadata for the cloned table.
Show answer and explanation
Correct answers: A, B, E
Explanation
Shallow clones are faster to create because they only copy metadata and reference the same data files as the source table. They rely on the source table's existence. In contrast, deep clones create independent copies of both metadata and data files, making them suitable for isolated testing or scenarios where the source table might be deleted. Both types of clones generate independent metadata for the target table.
- A. Correct.
Shallow clones only copy the metadata of the source table and create references to the original data files, rather than duplicating the data itself. This is why shallow clones are faster to create and consume less storage.
- B. Correct.
Deep clones create a full copy of both the table's metadata and data files, making them independent of the source table. This allows deep clones to be used in isolated environments.
- C. Incorrect.
Shallow clones depend on the source table's data files. If the source table is deleted or its underlying data files are removed, the shallow clone will lose access to the data.
- D. Incorrect.
Deep clones take longer to create than shallow clones because they involve copying the actual data files, making them independent of the source. This statement is incorrect.
- E. Correct.
Both shallow and deep clones create new, independent metadata for the cloned table. However, only deep clones copy the underlying data files.