New to Kestra?
Use blueprints to kickstart your first workflows.
Audits Apache Iceberg table snapshots and metadata file sprawl to prevent query planning latency regression.
This workflow connects to Apache Iceberg metadata catalogs via the JDBC Trino plugin to query the $snapshots metadata system table for critical production tables. Every append, overwrite, or delete transaction in Apache Iceberg creates an immutable snapshot. If table maintenance procedures (such as expire_snapshots and remove_orphan_files) are not run periodically, tables accumulate hundreds of old snapshots and thousands of manifest list files. This metadata sprawl causes query planning times in Trino, Spark, and Presto to balloon from milliseconds to minutes. This workflow tracks snapshot counts and alerts data lake teams.
SLACK_WEBHOOK configured in Kestra.ALTER TABLE ... EXECUTE expire_snapshots(retention_threshold => '7d').$files metadata table to identify small file fragmentation requiring compaction.