Delta Lake, the lakehouse table format
kept in this browser
Edit this pageDelta Lake is Parquet plus a transaction log. The log provides ACID transactions, time travel, schema enforcement, and a history you can inspect with DESCRIBE HISTORY.
Checked against the Databricks documentation on · history
On this page10
What it is
Delta Lake is the default table format on Databricks. A Delta table is a folder in object storage with two things inside: the data files in Parquet and a _delta_log/ subfolder holding the transaction log, a sequence of JSON files (plus Parquet checkpoints) that records every commit. The log protocol is open, so any engine that understands it can read the table.
Why it exists
Parquet on its own is a file format, not a table format. If two jobs write to the same folder, or one reads while another deletes files, the outcome is unpredictable; if a job fails halfway through, partial files are left behind; if someone adds a column with the wrong type, nobody notices. The transaction log fixes all of this by giving the folder the semantics of a database table.
How it works
ACID transactions
Every write (INSERT, UPDATE, DELETE, MERGE, OPTIMIZE) produces a new version: it adds or removes Parquet files and writes a commit to the log. Readers always see the latest complete version, never an intermediate state. A failed job leaves no dirty data behind: without a commit, the files it wrote are invisible.
Time travel
The log keeps past versions, so you can query the table as it was:
SELECT * FROM main.sales.orders VERSION AS OF 12;
SELECT * FROM main.sales.orders TIMESTAMP AS OF '2026-09-01T00:00:00Z';
RESTORE TABLE main.sales.orders TO VERSION AS OF 12;spark.read.option("versionAsOf", 12).table("main.sales.orders")
spark.read.option("timestampAsOf", "2026-09-01").table("main.sales.orders")
spark.sql("RESTORE TABLE main.sales.orders TO VERSION AS OF 12")RESTORE doesn’t erase history: it creates a new version identical to the one you picked. There’s also the short form table@v12.
Time travel is not a backup. Two properties control how far back you can go:
| Property | Default | What it controls |
|---|---|---|
delta.logRetentionDuration | 30 days | how long the commit log is kept |
delta.deletedFileRetentionDuration | 7 days | how long VACUUM keeps files that are no longer referenced |
If the files of a version have been removed by VACUUM, that version is no longer readable even if the log entry still exists.
Schema enforcement and evolution
On write, Delta compares the schema of the incoming data with the table’s schema. New columns, incompatible types, or names that differ only by case make the write fail. That’s by design: better an error than a phantom column. When you actually want evolution, you ask for it explicitly:
ALTER TABLE main.sales.orders ADD COLUMNS (canale STRING);(df.write
.option("mergeSchema", "true")
.mode("append")
.saveAsTable("main.sales.orders"))overwriteSchema replaces the schema entirely during an overwrite. The session config spark.databricks.delta.schema.autoMerge.enabled exists but is discouraged in production.
History
DESCRIBE HISTORY main.sales.orders;
DESCRIBE HISTORY main.sales.orders LIMIT 5;
Returns one row per version with version, timestamp, userName, operation (WRITE, MERGE, DELETE, OPTIMIZE…), operationParameters, and metrics such as rows written. It’s the first place to look when a table “changed and I don’t know who did it”.
Maintenance
- OPTIMIZE: compacts many small files into large ones; streaming and frequent appends produce a lot of them.
- VACUUM: physically deletes files that no recent version uses anymore, honoring the retention period (default 7 days).
- Managed tables in Unity Catalog can delegate both to predictive optimization (see Liquid clustering).
Example
An overnight job runs a bad DELETE on the silver table. The next morning:
DESCRIBE HISTORY main.silver.customers LIMIT 3;
-- version 41: DELETE, 120000 rows removed, userName job-etl
SELECT COUNT(*) FROM main.silver.customers VERSION AS OF 40;
RESTORE TABLE main.silver.customers TO VERSION AS OF 40;
Version 42 is now identical to 40, and 41 stays available for post-mortem analysis.
Common mistakes
- Using time travel as a historical archive: after
VACUUM, old versions are no longer readable. - Running
VACUUM ... RETAIN 0 HOURSto free up space: it breaks in-flight reads and any chance of recovery. - Sidestepping schema enforcement with
mergeSchemaenabled by default in every job: wrong columns slip in silently. - Expecting
RESTOREto delete later versions: it adds a version, it doesn’t rewrite history. - Writing Parquet “by hand” into a Delta table’s folder: the log doesn’t know about it, so the files are either invisible or corrupt the table.
Exam hints
Rewritten from real exam questions: what gets asked and where people slip.
- The exam checks whether you know what Delta Lake adds on top of files: a transaction log for reliable table writes and schema rules. The trap is choosing a governance or storage layer instead. Remember: ACID transactions and schema enforcement come from the Delta table format.
- Delta time travel lets readers query an older table snapshot without changing the current Delta table. The trap is confusing read-only history access with maintenance or rollback commands like
VACUUMorRESTORE. UseDESCRIBE HISTORYto find the commit and query it withVERSION AS OF. - The exam checks that Delta Lake is a table format, not a separate data-file encoding. The common trap is choosing the table format name as if it were the stored file type. Remember: Delta tables store data files as Parquet and add the transaction log for ACID behavior and table history.
- The exam checks that a Delta table is not just rows in Parquet files. The common trap is to ignore the transaction log and think the table is only data files. Remember: Delta = Parquet data files plus the
_delta_logthat tracks metadata and versions. - The exam checks why Delta tables make lakehouse data more trustworthy. The trap is picking general conveniences like SQL access or mixed data types; the rule is that ACID transactions from the Delta transaction log protect consistency when data is written or changed.
- The exam checks that ACID transactions are a data quality feature, not just a storage feature. The trap is picking broad lakehouse benefits like SQL access, open files, or mixed data types. Remember: Delta Lake’s transaction log is what keeps table changes consistent and reliable.
- The exam checks whether you know which Delta SQL DML statement changes table contents. The common trap is picking a query that only reads data, or an
UPDATEthat changes column values but keeps the rows. Remember: DELETE removes rows that match itsWHEREpredicate.
Where this sits
- Data Engineer AssociateDatabricks Intelligence Platform6% of the exam“Understand the core components of the Databricks Data Intelligence Platform, such as its architecture, Delta Lake, and Unity Catalog.”
- Learning pathLakehouse FoundationsHow the Databricks platform is put together: control plane and compute, Delta Lake as the …
- Learning pathSQL & AnalyticsQuery the lakehouse from the SQL editor, model gold tables and views for BI, and understan…
Nothing of that kind here yet. Try the full list.