Apache Iceberg version
1.9.2 (latest release)
Query engine
None
Please describe the bug 🐞
Iceberg's rewrite_table_path procedure (RewriteTablePath Spark action) does not update sizes of rewritten manifests in manifest lists that reference them.
Specifically, when RewriteTablePathUtil.rewriteManifestList rewrites the manifest list, it copies the contained manifests and only updates their paths. Manifest lists are rewritten first and manifest files are rewritten second, so the utility has no way of knowing final sizes of the rewritten manifest files. This is very similar to #12554.
Mismatch between manifest size in manifest list and size of the physical manifest file may cause correctness problems in some query engines. For example if the actual manifest file is larger than its size recorded in manifest lists, Trino may only read part of it and ignore the rest, effectively skipping manifest entries (referenced data and delete files) silently.
This is reproducible in Iceberg 1.8.1 at least, and based on the source code this is also true for later versions.
Willingness to contribute
Apache Iceberg version
1.9.2 (latest release)
Query engine
None
Please describe the bug 🐞
Iceberg's
rewrite_table_pathprocedure (RewriteTablePathSpark action) does not update sizes of rewritten manifests in manifest lists that reference them.Specifically, when
RewriteTablePathUtil.rewriteManifestListrewrites the manifest list, it copies the contained manifests and only updates their paths. Manifest lists are rewritten first and manifest files are rewritten second, so the utility has no way of knowing final sizes of the rewritten manifest files. This is very similar to #12554.Mismatch between manifest size in manifest list and size of the physical manifest file may cause correctness problems in some query engines. For example if the actual manifest file is larger than its size recorded in manifest lists, Trino may only read part of it and ignore the rest, effectively skipping manifest entries (referenced data and delete files) silently.
This is reproducible in Iceberg 1.8.1 at least, and based on the source code this is also true for later versions.
Willingness to contribute