Skip to content

Commit

Permalink
Add docs for Iceberg expire_snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
homar authored and findepi committed Apr 28, 2022
1 parent aeb75f2 commit 7f9eb0b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/src/main/sphinx/connector/iceberg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,24 @@ to the filter:
ALTER TABLE test_partitioned_table EXECUTE optimize
WHERE partition_key = 1
expire_snapshots
~~~~~~~~~~~~~~~~

The ``expire_snapshots`` command removes all snapshots and all related metadata and data files.
Regularly expiring snapshots is recommended to delete data files that are no longer needed,
and to keep the size of table metadata small.
The procedure affects all snapshots that are older than the time period configured with the ``retention_threshold`` parameter.

``expire_snapshots`` can be run as follows:

.. code-block:: sql
ALTER TABLE test_table EXECUTE expire_snapshots(retention_threshold => '7d')
The ``iceberg.expire_snapshots.min-retention`` catalog configuration property prevents from running
``expire_snapshots`` with ``retention_threshold`` set to value lower than ``iceberg.expire_snapshots.min-retention``.
The default value for this property is ``7d``.

.. _iceberg-type-mapping:

Type mapping
Expand Down

0 comments on commit 7f9eb0b

Please sign in to comment.