Updated on 2026-11-06 GMT+08:00

Iceberg Table Services

Aura offers a range of table services that you can use as needed, for example, cleaning up old snapshots, organizing metadata and data files, to enhance storage and query efficiency. For details about the syntax, see Iceberg Table Service Functions.

Examples:

  • Clean up old snapshots.
    select * from iceberg_expire_snapshots('iceberg_test','2025-05-15 14:12:00+08');
    deleted_data_files_count | deleted_position_delete_files_count | deleted_equality_delete_files_count | deleted_manifest_files_count | deleted_manifest_lists_count | deleted_statistics_files_count
    ----------------------------+---------------------------------------+----------------------------------------+--------------------------------+--------------------------------+--------------------------------
    0                                       | 0                                                        | 0                                                         | 0                                             | 3                                              | 0
    (1 row)
  • Rewrite metadata files.
    SELECT * from iceberg_rewrite_manifests('test1');
    rewritten_manifests_count | added_manifests_count
    ---------------------------+-----------------------
    2                                     | 1
    (1 row)
  • Remove orphaned files.
    SELECT * from iceberg_remove_orphanfiles('iceberg_test');
    orphan_file_location
    -------------------------------------------------------------
    obs://xxxx/test.txt
    obs://xxxx/test2.txt
    (2 rows)
  • Rewrite data files.
    OPTIMIZE reason_t2 REWRITE DATA WITH OPTIONS ('rewrite-all' = 'true') WHERE TABLE_SC = 'Hainan';
    INSERT 2