Databricks Data Engineer Professional Question 20
Single answerA data engineering team wants to create a copy of a Delta table in their Databricks workspace to test changes without affecting the original data. They need the copy to maintain the same table structure, data, and transactional history. Which Delta clone option should they use?
- A
CREATE CLONE ... SHALLOW CLONE
- B
CREATE CLONE ... DEEP CLONE
- C
CREATE TABLE ... USING DELTA AS SELECT
- D
COPY INTO ... FROM DeltaTable
Show answer and explanation
Correct answer: B
Explanation
To create a copy of a Delta table for testing purposes that includes both the data and transactional history, a Deep Clone is required. This ensures that changes made to the cloned table do not affect the original table. Shallow clones reference the same underlying data, making them unsuitable for independent testing. Other options like 'CREATE TABLE ... USING DELTA AS SELECT' and 'COPY INTO' do not provide the same functionality as Delta clones.
- A. Incorrect.
Shallow Clones only copy metadata and reference the same data files as the original table. They do not maintain independent transactional history, making them unsuitable for testing changes without affecting the original data.
- B. Correct.
Deep Clones create a full copy of the data and transactional history, which allows changes to be tested in the clone without impacting the original table. This is ideal for the given scenario.
- C. Incorrect.
This method creates a new Delta table by copying the data using a query, but it does not include transactional history or other Delta-specific features, making it unsuitable for this use case.
- D. Incorrect.
COPY INTO is used for loading data into a Delta table from external sources and is not related to creating Delta clones.