Skip to content

rewrite_table_path does not update sizes of rewritten manifests in manifest lists #13719

Description

@vaultah

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

  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions