diff --git a/presto-docs/src/main/sphinx/connector/iceberg.rst b/presto-docs/src/main/sphinx/connector/iceberg.rst index ff457768fc2ee..235cfee93852b 100644 --- a/presto-docs/src/main/sphinx/connector/iceberg.rst +++ b/presto-docs/src/main/sphinx/connector/iceberg.rst @@ -1926,6 +1926,37 @@ Iceberg tables do not support running multiple :doc:`../sql/merge` statements on Failed to commit Iceberg update to table: Found conflicting files that can contain records matching true +Transaction support +^^^^^^^^^^^^^^^^^^^ + +The Iceberg connector supports explicit multi-statement transactions with writes +to a single Iceberg table. To run transaction statements, use +:doc:`/sql/start-transaction` with :doc:`/sql/commit` or :doc:`/sql/rollback`. + +The Iceberg connector provides snapshot isolation at ``REPEATABLE READ`` level. +This also satisfies ``READ COMMITTED`` and ``READ UNCOMMITTED``, so these +isolation levels are supported as well. For snapshot semantics, use +``REPEATABLE READ``:: + + START TRANSACTION ISOLATION LEVEL REPEATABLE READ; + INSERT INTO iceberg.default.test_table (id, status) VALUES (1, 'pending'); + UPDATE iceberg.default.test_table SET status = 'committed' WHERE id = 1; + COMMIT; + +Limitations: + +* Writes in the same transaction can target only one Iceberg table. Attempts + to write to another table fail with ``Not allowed to open write transactions on multiple tables``. +* ``SERIALIZABLE`` isolation is not supported by the Iceberg connector. +* The following statements are only supported in autocommit mode: + ``MERGE INTO``, ``CREATE/DROP/RENAME TABLE``, + ``CREATE/DROP/RENAME SCHEMA``, ``CREATE/DROP/RENAME VIEW``, + ``CREATE/DROP/REFRESH MATERIALIZED VIEW``, ``TRUNCATE TABLE``, and + ``ANALYZE``. +* ``CALL`` statements are only supported in autocommit mode. +* If concurrent transactions change table metadata, commit may fail and require + retrying the transaction (for example, ``Table metadata refresh is required``). + .. _iceberg_analyze: Collecting table and column statistics