"I want to try new ETL logic against production data without polluting production." "Copying a huge table takes forever." Delta Clone solves both of these problems. DEEP CLONE produces a fully independent copy of the data, while SHALLOW CLONE shares the underlying data files with the source and creates the clone almost instantly.
This article walks through the differences between DEEP and SHALLOW CLONE, their syntax, how to choose between them by use case, how they interact with VACUUM, Time Travel, and metadata, and the points most likely to appear on the exam.
| Dimension | DEEP CLONE | SHALLOW CLONE |
|---|---|---|
| Data copy | Physically copies every data file | References data files only (no copy) |
| Creation speed | Proportional to data size (slow on large tables) | Fast — only metadata is copied |
| Storage cost | Roughly equal to the source | Near zero (only writes to the clone consume storage) |
| Independence from source | Fully independent (unaffected by changes or deletes on the source) | Depends on the source (can break when the source runs VACUUM) |
| Metadata | Schema, constraints, and properties fully copied | Schema, constraints, and properties fully copied |
| VACUUM impact | None | Breaks if VACUUM on the source deletes referenced files |
| Time Travel | Clone gets its own history starting at version 0 | Clone gets its own history starting at version 0 |
-- DEEP CLONE: データの完全コピー
CREATE TABLE dev.sandbox.orders_clone
DEEP CLONE prod.silver.orders;
-- SHALLOW CLONE: メタデータのみコピー(データは参照)
CREATE TABLE dev.sandbox.orders_shallow
SHALLOW CLONE prod.silver.orders;
-- 特定バージョンのクローン(Time Travel)
CREATE TABLE dev.sandbox.orders_v5
DEEP CLONE prod.silver.orders VERSION AS OF 5;
-- 特定タイムスタンプのクローン
CREATE TABLE dev.sandbox.orders_snapshot
SHALLOW CLONE prod.silver.orders TIMESTAMP AS OF '2026-03-25';
-- 既存テーブルの差分更新(増分DEEP CLONE)
CREATE OR REPLACE TABLE dev.sandbox.orders_clone
DEEP CLONE prod.silver.orders;Re-running a DEEP CLONE with CREATE OR REPLACE only copies the delta since the previous clone. This is called an incremental clone, and it works well as a daily sync pattern.
When a data scientist wants to try a new model against production data, SHALLOW CLONE is the best fit. Even a multi-terabyte table can be cloned in seconds, freeing you to experiment with joins and filters. Writes to the clone do not touch the source.
-- 実験用にSHALLOW CLONEを作成
CREATE TABLE dev.ml_experiments.user_features
SHALLOW CLONE prod.gold.user_features;
-- クローン上で自由に実験(ソースに影響なし)
ALTER TABLE dev.ml_experiments.user_features
ADD COLUMN age_bucket STRING;
UPDATE dev.ml_experiments.user_features
SET age_bucket = CASE
WHEN age < 25 THEN 'young'
WHEN age < 50 THEN 'middle'
ELSE 'senior'
END;When you test changes to ETL logic, create a full copy of the production table with DEEP CLONE and run the entire pipeline against it in your test environment. Because a DEEP CLONE is fully independent of the source, running VACUUM during the test or hitting a pipeline failure has no effect on production.
-- テスト用にDEEP CLONEを作成
CREATE TABLE staging.test.orders
DEEP CLONE prod.silver.orders;
CREATE TABLE staging.test.customers
DEEP CLONE prod.silver.customers;
-- テスト環境でETLパイプラインを実行
-- 結果が期待通りか検証後、本番に適用When compliance requires long-term snapshots of your data, DEEP CLONE is the right tool. The archive holds a specific point in time and is unaffected by VACUUM or schema changes on the source table.
-- 月次のアーカイブスナップショット
CREATE TABLE archive.monthly.orders_202603
DEEP CLONE prod.silver.orders
TIMESTAMP AS OF '2026-03-31 23:59:59';Not cloned: table change history, streaming checkpoints, and Unity Catalog grants (the clone inherits the default permissions of its destination).
The biggest risk with SHALLOW CLONE is VACUUM on the source. Once VACUUM deletes data files older than the retention period, any query against a SHALLOW CLONE that still references those files will fail.
-- ソースのVACUUM保持期間を確認
DESCRIBE DETAIL prod.silver.orders;
-- delta.deletedFileRetentionDuration を確認
-- SHALLOW CLONEを安全に使う場合の推奨設定
ALTER TABLE prod.silver.orders
SET TBLPROPERTIES (
'delta.deletedFileRetentionDuration' = 'interval 30 days'
);Data Engineer Associate / Professional
問題 1
A data engineer wants to test new ETL transformation logic against a copy of a 5 TB production table. The test will run for one week, after which the clone will be deleted. The production table runs VACUUM daily with a 7-day retention period. Which approach is most appropriate?
正解: A
With daily VACUUM at 7-day retention, a SHALLOW CLONE used for a week is at real risk of failing as referenced files get deleted. DEEP CLONE copies the data fully and is unaffected by source-side VACUUM. CTAS would also work, but it loses constraints and table properties, making it weaker than DEEP CLONE. Modifying the production table directly is out of the question.
What happens if VACUUM runs on the source table behind a SHALLOW CLONE?
Because a SHALLOW CLONE only references the source table's data files, queries against the clone will fail once VACUUM deletes the old files from the source. When you rely on a SHALLOW CLONE, either set the source's VACUUM retention period longer than the clone's lifetime, or convert the clone into a DEEP CLONE.
What is the difference between DEEP CLONE and CTAS (CREATE TABLE AS SELECT)?
DEEP CLONE copies the data files and also fully replicates table metadata (schema, constraints, table properties, partition information). CTAS only writes the SELECT result into a new table — NOT NULL constraints, CHECK constraints, and table properties are not carried over. If you need to preserve constraints and properties, DEEP CLONE is the right choice.
What happens when you write data into a SHALLOW CLONE?
Writes to a SHALLOW CLONE (INSERT/UPDATE/DELETE) are stored as data files that belong to the clone, with no impact on the source table. In effect, the clone gradually accumulates its own data and partially behaves like a DEEP CLONE. However, the portion of files still referenced from the source remains exposed to source-side VACUUM.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Databricks Certifications: All 7 Exams, Difficulty & Study Plan (2026)
Complete guide to all 7 Databricks certifications — Data Eng...
Databricks Exam Difficulty Ranking: All 7 Certs Compared (2026)
Every Databricks certification ranked by difficulty, with st...
Databricks Study Guide: Fastest Pass Route & Time Estimates (2026)
How to pass Databricks certifications efficiently. Official ...
Databricks Data Engineer Associate: Complete Guide (2026)
Domain-by-domain breakdown of the Databricks Certified Data ...
Databricks Data Engineer Professional: Complete Guide (2026)
Tactics for the Databricks Certified Data Engineer Professio...