ReferenceApplies to: Unified engine deployments
Iceberg format v2 can record row changes in positional-delete files. Each delete entry identifies a row position in a data file. Delete compaction combines eligible delete files while preserving which rows readers should hide.
Before you start
Choose a writable Iceberg catalog in Workbench and an unused practice namespace. The table must support row deletes and format-v2 maintenance. This recipe uses only inline data and replaces maintenance_docs.delete_demo.
Create row changes, compact, and verify
The script writes six rows, deletes one row from each of two writes, compacts eligible positional-delete files, and checks the visible rows.
After the deletes and again after maintenance, the aggregate result should be:
The remaining rows have IDs 1, 3, 4, and 6. Compaction must not bring IDs 2 or 5 back into the visible result.
Read the maintenance result
Select the CALL statement in Workbench’s results.
Refresh Catalogs → table → Inspection → Files and compare the delete-file entries before and after the operation. Exact counts depend on the delete writer and eligible files. If the table has no qualifying positional-delete files, a successful no-op is valid.
Understand what changes
Delete compaction reorganizes the files that describe deleted positions. It does not mean that deleted row values have been physically removed from every data file or old snapshot.
The current action handles positional-delete files. Do not use it as an equality-delete rewrite, snapshot-expiry procedure, or orphan cleanup operation. Those are different operations with different support requirements.
Use SQL queries for exact visible row counts. File metadata can contain overlapping delete entries, so subtracting delete entries from data-record totals is not an exact row-count calculation.
Clean up
After the operation completes, remove the practice table through the catalog:
See data compaction for data-file layout and TBLPROPERTIES for later write settings.Last modified on November 4, 2026