Skip to content

Field-id detection checks only the first column, so files with a leading id-less column are read by position #3608

Open

Description

@c-thiel

Apache Iceberg Rust version

main @ 1ee5c72

Describe the bug

reader/pipeline.rs decides whether a Parquet file has field ids from the first top-level field only (missing_field_ids). If that field has no id and there is no name mapping, every top-level column gets a positional fallback id, overwriting the ids the other columns carry. A column whose embedded id differs from its 1-based position then silently reads as NULL, or as another column's values.

The code comment says this corresponds to Java's ParquetSchemaUtil.hasIds(). That check is true if any field at any depth has an id.

To Reproduce

File optional int32 junk; optional int32 c = 4; (no id on junk) with c = [7, 8]. Table schema optional 4: c int, projecting [4], no name mapping.

Actual: c = [null, null]. With c = 1 and junk = [100, 200], the scan returns junk's values [100, 200] for c.

Expected behavior

c = [7, 8], as iceberg-java returns for both files (run on 1.9.1; ReadConf and ParquetSchemaUtil.HasIds are unchanged through 1.12.0). Treat a file as having no field ids only if no field at any depth has one.

Willingness to contribute

I can contribute a fix for this bug independently

Activity

  1. added
    bug
    on Nov 2, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions