Manifest rewriting is an Apache Iceberg maintenance procedure that consolidates fragmented manifest files describing table data. Fewer, better-organized manifests reduce metadata traversal during query planning and snapshot management without rewriting the underlying data files. section 10.1.3 section 10.2.1
Use manifest rewriting when metadata growth becomes a reliability, latency, or scalability concern:
- Run it alongside snapshot expiration; data-file compaction alone does not control growth in manifests and metadata.json. section 10.1.3
- Treat it as distinct from rewrite_data_files: manifest rewriting reorganizes metadata, while data-file compaction changes physical file layout. section 10.2.1
- Schedule it regularly or trigger it from metadata conditions; incremental maintenance can do little work or exit when optimization is unnecessary. section 11.1.2
Spark procedure
Invoke the Iceberg Spark procedure with: CALL catalog_name.system.rewrite_manifests('db.sales'); section 10.2.1
Figure 10.5 Ideally, you’ll have fewer manifest files tracking fewer data files containing a greater number of records per file, minimizing the cost of metadata traversal and data file I/O.
Use the ideal metadata layout as a visual target: fewer manifest files should track fewer, better-sized data files, reducing metadata traversal and data-file I/O. section 10.1.3
