Skip to main content
Version: 26.2 Preview

iceberg_maintenance_tasks

iceberg_maintenance_tasks provides information about Iceberg metadata maintenance tasks, including both tasks triggered automatically by Iceberg metadata auto maintenance and tasks executed manually via ALTER TABLE ... EXECUTE.

The following fields are provided in iceberg_maintenance_tasks:

FieldDescription
TASK_IDUnique ID of the maintenance task.
CATALOG_NAMEName of the catalog the table belongs to.
DATABASE_NAMEName of the database the table belongs to.
TABLE_NAMEName of the table.
ACTIONMaintenance action. Valid values: expire_snapshots, remove_orphan_files, and rewrite_manifests.
TRIGGER_REASONHow the task was triggered. Valid values: schedule (triggered by auto maintenance) and manual (executed via ALTER TABLE ... EXECUTE).
STMTThe SQL statement for manually triggered tasks. NULL for automatically triggered tasks.
START_TIMETime when the task started.
END_TIMETime when the task finished.
DURATION_MSDuration of the task in milliseconds.
STATUSStatus of the task. Valid values: success (changed table state), skipped (ran but had nothing to do), failed, and partial (some changes were applied before a failure, for example, part of the orphan files were already deleted).
FAILURE_REASONFailure reason for failed tasks.
DETAILSJSON object with action-specific execution details: for expire_snapshots, snapshot counts before and after execution; for rewrite_manifests, manifest file counts and bytes before and after execution; for remove_orphan_files, the number of detected and removed orphan files and the reclaimed bytes.
note

The task history is kept in the memory of the leader FE only, bounded by the FE configuration items iceberg_maintenance_task_history_ttl_second and iceberg_maintenance_task_history_max_number. It is lost when the FE restarts or the leader changes.