Skip to content

Commit

Permalink
Add docs for Iceberg delete_orphan_files
Browse files Browse the repository at this point in the history
  • Loading branch information
homar authored and findepi committed Apr 28, 2022
1 parent 7f9eb0b commit 57983d9
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions docs/src/main/sphinx/connector/iceberg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,27 @@ The procedure affects all snapshots that are older than the time period configur
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 value for ``retention_threshold`` must be higher than ``iceberg.expire_snapshots.min-retention`` in the catalog
otherwise the procedure will fail with similar message:
``Retention specified (1.00d) is shorter than the minimum retention configured in the system (7.00d)``.
The default value for this property is ``7d``.

delete_orphan_files
~~~~~~~~~~~~~~~~~~~

The ``delete_orphan_files`` command removes all files from table's data directory which are
not linked from metadata files and that are older than the value of ``retention_threshold`` parameter.
Deleting orphan files from time to time is recommended to keep size of table's data directory under control.

``delete_orphan_files`` can be run as follows:

.. code-block:: sql
ALTER TABLE test_table EXECUTE delete_orphan_files(retention_threshold => '7d')
The value for ``retention_threshold`` must be higher than ``iceberg.delete_orphan_files.min-retention`` in the catalog
otherwise the procedure will fail with similar message:
``Retention specified (1.00d) is shorter than the minimum retention configured in the system (7.00d)``.
The default value for this property is ``7d``.

.. _iceberg-type-mapping:
Expand Down

0 comments on commit 57983d9

Please sign in to comment.