Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This page describes isolation levels and write conflict behavior for Delta Lake tables on Azure Databricks.
Delta Lake provides ACID transaction guarantees between reads and writes:
- Writers: Multiple writers across multiple clusters can simultaneously modify a table partition. Writers see a consistent snapshot view of the table and writes occur in a serial order.
- Readers: Readers continue to see a consistent snapshot view of the table that the Azure Databricks job started with, even when a table is modified during a job.
See What are ACID guarantees on Azure Databricks?.
Note
Azure Databricks uses Delta Lake for all tables by default.
Isolation topics
| Topic | Description |
|---|---|
| Isolation levels (WriteSerializable and Serializable) | How the two isolation levels affect concurrent operations and how to configure them. |
| Row-level concurrency | How row-level conflict detection reduces write conflicts for concurrent operations on the same data files. |
For information about transaction isolation, snapshot behavior, and conflict handling, see Transaction isolation.
Metadata change conflicts
Metadata changes cause all concurrent write operations to fail. These operations include changes to table protocol, table properties, or data schema.
Streaming reads fail when they encounter a commit that changes table metadata. If you want the stream to continue, you must restart it. For recommended methods, see Production considerations for Structured Streaming.
The following are examples of queries that change metadata:
-- Set a table property
ALTER TABLE table_name SET TBLPROPERTIES ('delta.isolationLevel' = 'Serializable')
-- Enable a feature using a table property and update the table protocol
ALTER TABLE table_name SET TBLPROPERTIES ('delta.enableDeletionVectors' = true);
-- Drop a table feature
ALTER TABLE table_name DROP FEATURE deletionVectors;
-- Upgrade to UniForm
REORG TABLE table_name APPLY (UPGRADE UNIFORM(ICEBERG_COMPAT_VERSION=2));
-- Update the table schema
ALTER TABLE table_name ADD COLUMNS (col_name STRING);