Databricks Data Engineer Professional Question 21
Single answerA data engineering team is tasked with creating a Delta table clone for testing purposes in Databricks. They want to ensure that the clone operation is lightweight and does not duplicate the underlying data files. Which type of Delta clone should they use, and what is a key requirement for this operation?
- A
Use a shallow clone, which creates a new Delta table referencing the same data files as the source table.
- B
Use a deep clone, which creates a new Delta table and copies the data files from the source table.
- C
Use a shallow clone, but ensure that the source table's data files are stored in a cloud storage location accessible by the target workspace.
- D
Use a deep clone, but ensure that the source table and target table reside in the same Databricks workspace.
Show answer and explanation
Correct answer: C
Explanation
Shallow clones in Delta Lake are designed to create a new Delta table that references the same underlying data files as the source table, making the operation fast and efficient. However, an important requirement for this operation is that the source table's data files must reside in a cloud storage location that is accessible to the target workspace. This ensures the cloned table can properly reference the source data without copying it.
- A. Incorrect.
Correct: Shallow clones reference the same data files as the source table, making them lightweight and efficient. However, the prerequisite is that the source table's data files must be in a location accessible by the target workspace.
- B. Incorrect.
Incorrect: Deep clones are not lightweight because they copy the data files. This would duplicate the underlying data, which is not the desired behavior in this scenario.
- C. Correct.
Correct: Shallow clones are the appropriate choice for a lightweight operation, but it’s essential that the source table's data files are stored in a cloud storage location that can be accessed by the target workspace.
- D. Incorrect.
Incorrect: Deep clones require data copying and are not relevant to the goal of creating a lightweight clone. Additionally, deep clones do not require the source and target tables to be in the same workspace.