USER MANUALS

REMOVE_ICEBERG_VIEW_ORPHAN_FILES

Description

The stored procedure REMOVE_ICEBERG_VIEW_ORPHAN_FILES removes the files which are not referenced by any metadata file of an Iceberg view.

Syntax

REMOVE_ICEBERG_VIEW_ORPHAN_FILES (
    database_name : text,
    view_name : text,
    older_than : timestamp
)
  • database_name: name of the database containing the view. If the database does not exist the procedure returns an error.

  • view_name: name of the view. If the view does not exist the procedure returns an error.

  • older_than (optional): timestamp before which orphan files will be removed. Default value: 3 days ago.

This stored procedure return one row, with the following schema:

  • success: true if the procedure executed successfully, false otherwise.

  • error_description: if the procedure execution resulted in an error, this field shows an error description.

Privileges required

Only users that have Delete privileges on the base view can execute this procedure. This means, the following users can execute this procedure:

  • Administrators or administrators on the database.

  • Users that have Connect privilege on the database and Delete privileges on the base view.

Examples

  • Execute procedure on view test_database.test_view with the default parameters: CALL REMOVE_ICEBERG_VIEW_ORPHAN_FILES('test_database', 'test_view').

  • Execute procedure on view test_database.test_view removing orphan files older than 20 days if current timestamp is 30-01-2025 12:13:14: CALL REMOVE_ICEBERG_VIEW_ORPHAN_FILES('test_database', 'test_view', '10-01-2025 12:13:14').

Add feedback