Skip to content

UpdateSchemaAction does not update schema.name-mapping.default, so columns added later can't be read from id-less files #3664

Closed

Description

@viirya

What's the issue?

For tables migrated from Hive (or with files registered through add_files), readers resolve columns in Parquet files that have no field ids through the schema.name-mapping.default table property. Iceberg Java keeps that mapping in step with the schema: SchemaUpdate.commit calls MappingUtil.update, which adds an entry for every added column (including nested fields, under their parent's entry) and adds the new name of a renamed column as an alias.

UpdateSchemaAction in iceberg-rust emits only AddSchema and SetCurrentSchema, and nothing else in the crate updates the property when the schema changes. After adding a column through iceberg-rust, the mapping has no entry for it. Files written later by an engine that does not write field ids (or files added later through add_files) then read the new column as NULL, while Java resolves it by name.

Expected behavior

When UpdateSchemaAction commits on a table that has schema.name-mapping.default, the same commit updates the mapping as Java does: each added column gets an entry under its parent, and an existing entry in the same struct that held that name loses it (a column dropped and re-added under the same name). Deleted columns keep their entries. If the property is absent, nothing changes; if it can't be parsed, Java logs a warning and commits the schema change anyway.

Rename support (#2562) would need the same alias handling when it lands.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions