Atomic transactions for Delta Lake and Apache Iceberg tables in Databricks
You can now run atomic multi-table SQL transactions across Unity Catalog managed Delta Lake and Iceberg tables using Catalog Commits.
O que mudou
Databricks has made multi-table SQL transactions generally available (GA) for Unity Catalog managed Delta Lake and Apache Iceberg tables. This feature groups commands across one or more managed tables into a single atomic transaction, ensuring all changes commit together or fail together.
Use cases
Imagine updating an inventory table and writing a sales record to another table within the same business event. If one statement fails, your data becomes inconsistent. With transactions, you can:
- Group multiple SQL statements across several tables into a single atomic commit.
- Maintain ACID guarantees across different tables managed by Unity Catalog.
- Work across Delta Lake and Apache Iceberg formats simultaneously.
How to use
Participating tables must have catalog commits enabled using the delta.feature.catalogManaged table property.
First, create a new table with the property or update an existing managed table:
-- Creating a new managed table
CREATE TABLE meu_catalogo.vendas.pedidos (
pedido_id BIGINT,
valor DECIMAL(10,2),
data_pedido DATE
)
TBLPROPERTIES ('delta.feature.catalogManaged' = 'supported');
-- Enabling on an existing managed table
ALTER TABLE meu_catalogo.vendas.estoque
SET TBLPROPERTIES ('delta.feature.catalogManaged' = 'supported');
What happens in this code:
- The first statement creates the
pedidostable with commits coordinated through Unity Catalog. - The second statement updates the existing
estoquetable to enable catalog-managed commits.
With catalog commits enabled on the participating tables, execute the transaction using BEGIN TRANSACTION or BEGIN ATOMIC:
BEGIN TRANSACTION;
INSERT INTO meu_catalogo.vendas.pedidos VALUES (101, 150.00, current_date());
UPDATE meu_catalogo.vendas.estoque SET quantidade = quantidade - 1 WHERE produto_id = 42;
COMMIT;
What happens in this code:
- The
BEGIN TRANSACTIONstatement initiates the transaction boundary. - The
INSERTandUPDATEstatements are staged. - The
COMMITstatement applies changes to both tables atomically; if any statement fails, changes are aborted.
To check if a table has catalog commits enabled:
DESCRIBE DETAIL meu_catalogo.vendas.pedidos;
Limitations and requirements
- Multi-table transactions are GA, while the underlying Catalog Commits feature is listed in Beta.
- Tables must be Unity Catalog managed tables (Delta or Iceberg), streaming tables, or materialized views.
- Databricks Runtime 16.4 or above is required to read, write, or create managed tables with catalog commits.
- Databricks Runtime 18.0 or above is required to enable or disable catalog commits on existing managed tables.
- For streaming tables and materialized views, Databricks Runtime 17.3 or above (or serverless compute in Spark Declarative Pipelines) is required to read, write, or create objects, and Databricks Runtime 18 LTS or above is needed to disable the feature.
- You cannot turn catalog commits on or off on existing tables using
CREATE OR REPLACE TABLEorREPLACE TABLE; useALTER TABLEinstead. - Single-user clusters cannot access streaming tables that have catalog commits enabled.
Using it in a pipeline
In Gold or Silver data pipelines involving financial reconciliations or order fulfillment, wrap downstream dimension and fact updates in a transaction block to prevent reporting queries from seeing mismatched data states.
- unity catalog
- delta lake
- apache iceberg
- transactions
- catalog commits
Transactions support both managed Delta Lake and Apache Iceberg tables
Resumo e explicação gerados por IA a partir da release note oficial. Em caso de dúvida, a documentação oficial da plataforma prevalece.
Relacionadas
- DatabricksBeta
Conector do SurveyMonkey chega ao Lakeflow Connect no Databricks
O Lakeflow Connect agora conta com conector nativo para o SurveyMonkey em Beta, permitindo ingestão incremental de pesquisas, respostas e contatos com governança no Unity Catalog.
lakeflow connect · surveymonkey - DatabricksBeta
Lakeflow Connect adiciona conector do Oracle Eloqua em Beta
O Lakeflow Connect agora oferece um conector gerenciado em Beta para o Oracle Eloqua, permitindo ingestão incremental de dados de marketing governados pelo Unity Catalog.
lakeflow connect · oracle eloqua - DatabricksBeta
Ingira métricas do GA4 com o novo conector do Lakeflow Connect
O Lakeflow Connect ganha conector gerenciado em Beta para o Google Analytics 4, permitindo ingestão incremental de relatórios agregados via API com governança no Unity Catalog.
lakeflow connect · google analytics