Hi all,

Andrei, thanks for checking Java. I built that shape into a fixture and ran
it through four readers. The fixture holds the input only and waits on this
thread for its expected values [1]

The data file has field IDs on every top-level column and struct field, and
none on the list element, map key or map value. Its ID'd columns have names
the mapping does not list, so they resolve only by ID. Results:

- Java 1.11.0 (generic Parquet reader): the ID'd columns read correctly.
Any projection that includes the list or the map fails with "... is not in
the store", which confirms what Andrei saw.
- iceberg-go main: every projection fails, including one of only ID'd
columns. Its hasIDs check does not look below a field that has an ID, so
the file counts as fully ID'd and schema conversion fails at the list
element. My earlier "per field" description of iceberg-go does not hold for
nested fields.
- PyIceberg 0.12.0: every projection fails. One missing ID makes it resolve
the whole file through the mapping, which does not list the ID'd columns'
names.
- DuckDB 2.0.0 with the iceberg extension: the ID'd columns read correctly,
the list reads with the right length and every element null, and the map
fails because its required key has no ID.

So four readers give four results, and only two of them return the ID'd
columns at all. With the per-file rule agreed, I'd suggest the wording
settle two more things:

1. In a file that has field IDs, a field without one is not present in the
file. A list or map whose element, key or value is not present reads as
null as a whole. That extends Ryan's "that column is null" to nested
fields, without inventing entries or keys.
2. Whether a field that has an ID can be read does not depend on other
fields of the file lacking one, so a projection of ID'd columns returns
their values. With Andrei's two points (an ID at any nesting level counts,
and the check runs on the file schema), the result no longer depends on the
query.

If the community prefers that such a list or map fails the read instead,
that works for the fixture too. What matters is that the spec picks one.
Andrei, I'm happy to review the spec PR, and I'll write the fixture's
expected values to match whatever it says.

Thanks,
Sylwester

[1] https://github.com/apache/iceberg-verification/pull/27



czw., 19 lis 2026, 08:29 użytkownik Daksh Dave <[email protected]>
napisał:

> Thanks, Ryan, for clarifying.
>
> Sylwester, have you started the verification fixture? I’d be happy to help
> with the nested list/map cases Andrei reported and the
> projection-consistency tests.
>
> Thanks,
> Daksh
>
>
> On Mon, 16 Nov 2026 12:37:02 -0700, Ryan Blue via dev <
> [email protected]> wrote:
>
> Yes, a missing ID in a file means that the column is null.
>
> On Sun, Nov 15, 2026 at 4:06 PM Andrei Tserakhau via dev <
> [email protected]> wrote:
>
>> Hi all,
>>
>> Thanks, Sylwester, for the survey, and Russell for the history.
>>
>> +1 to per-file. iceberg-go is the per-field reader in the list. Once the
>> spec wording lands, we'll switch to the Java rule: if the file has any
>> field ID, resolve by ID only and ignore the mapping. That will change
>> results for anyone reading such files through iceberg-go today, so
>> we'll call it out in the release notes.
>>
>> On null vs fail, I tried the shape from this thread against Java main
>> (generic Parquet reader). A top-level or struct field without an ID
>> reads as null, as Ryan said. But a list or map whose element, key or
>> value has no ID fails the read with an IllegalArgumentException ("...
>> is not in the store"), with or without a mapping, for any projection
>> that includes that column. That looks accidental rather than designed,
>> so the spec should say which outcome is intended for nested fields.
>>
>> Two things for the wording: "field id information" should mean a field
>> ID at any nesting level, including list elements and map keys and
>> values, and the check should run on the file schema, not the projected
>> one, so the result doesn't depend on the query. Java already does both.
>>
>> For the spec fix (scoping the "columns without field id" rule from
>> #10835 to files without field IDs), I'm happy to help, either by
>> drafting the PR or by reviewing it if someone else takes it.
>>
>> Sylwester, for the fixture you offered on iceberg-verification #14, I'd
>> build it around this map shape, with the expected result following
>> whatever the spec settles on.
>>
>> Thanks,
>> Andrei
>>
>> On Sun, Nov 15, 2026 at 4:19 PM Sylwester Lachiewicz <
>> [email protected]> wrote:
>>
>>> Dear Russell and Ryan,
>>>
>>> Thank you for the clarification. This confirms that per-file behavior is
>>> the intended standard and that the per-column wording in #10835 was
>>> unintentional.
>>> My primary objective is ensuring alignment across readers, as current
>>> implementations vary significantly:
>>>
>>>   - Java: Determines behavior per file upon encountering any ID.
>>>   - PyIceberg: Applies this logic only when every node contains an ID.
>>>   - iceberg-rust: Evaluates based on the first top-level column.
>>>   - iceberg-go: Evaluates per field.
>>>
>>> While I will leave the final specification language to the maintainers,
>>> clarification on one detail would assist in aligning implementations: when
>>> a file contains IDs on only a subset of fields, should an un-ID'd field be
>>> treated as missing (and read as null), or should the reader fail?
>>>
>>> Once the specification wording is finalized, we can update the
>>> iceberg-verification fixture (companion to #14) to lock in this behavior
>>> for implementation testing.
>>>
>>> Best regards,
>>>
>>> Sylwester Lachiewicz
>>>
>>>
>>> On Fri, Nov 13, 2026 07:46 PM, Ryan Blue via dev <[email protected]>
>>> wrote:
>>>
>>>> I don't think it is a good idea to try to mix name mapping and IDs. The
>>>> reason why we check hasIds is that the presence of any ID means that the
>>>> file was written with IDs and we should trust them. If an ID is missing,
>>>> then that column is null.
>>>>
>>>> Name mapping is a fallback for files converted from Hive without any
>>>> IDs. The two should not be mixed.
>>>>
>>>> I agree with Russell's conclusion about fixing the changes that we made
>>>> for compatibility. But those changes mean that we can move forward without
>>>> some IDs, not that we use name mapping to fill them in.
>>>>
>>>> Ryan
>>>>
>>>> On Thu, Nov 12, 2026 at 12:30 PM Russell Spitzer <
>>>> [email protected]> wrote:
>>>>
>>>>> After digging into the history, the per-file reading is the original
>>>>> intent, and I'm less supportive of widening it.
>>>>>
>>>>> I ('m the problem, it's me) added the name mapping text in 2021 (#3542
>>>>> <https://github.com/apache/iceberg/issues/3542>, #3556
>>>>> <https://github.com/apache/iceberg/pull/3556>). The intent was always
>>>>> the whole file:
>>>>>
>>>>> *"These mappings provide fallback field ids to be used when a data
>>>>> file does not contain field id information."*
>>>>> The use case was files from Hive and other plain Parquet writers that
>>>>> don't write field IDs at all, which is why the rest of that section talks
>>>>> about imported data files.
>>>>>
>>>>> The per-column wording ("map field id to columns without field id")
>>>>> came in with #10835 <https://github.com/apache/iceberg/pull/10835> in
>>>>> 2024, when we clarified identity partition values
>>>>> and initial-default. Name mapping was split into its own resolution
>>>>> step there, but we weren't trying to change its scope, and partial files
>>>>> weren't discussed.
>>>>>
>>>>> Iceberg writers are required to store field IDs for every field, so a
>>>>> file with only some IDs isn't a valid Iceberg data file. From this thread,
>>>>> the only source of these files is Delta tables using column mapping
>>>>> without IcebergCompatV2. Delta only assigns IDs to struct fields,
>>>>> and IcebergCompatV2 exists specifically to add the missing IDs for
>>>>> list elements and map keys and values.
>>>>>
>>>>> So the proposal would change behavior we've had since 2021, based on a
>>>>> sentence added unintentionally in 2024, to support files from a
>>>>> Delta configuration that isn't meant to be Iceberg compatible. It also
>>>>> adds a new requirement for every
>>>>> implementation (per-field resolution, never overwriting embedded IDs,
>>>>> and defining what happens on collisions).
>>>>>
>>>>> I'd rather fix the 2024 sentence to match the original meaning: the
>>>>> name mapping applies to data files
>>>>> that don't contain field IDs. If we want name mappings to apply to
>>>>> files that have only some IDs, I think that's a new feature,
>>>>> and we should start from the use cases. So far the only one I've seen
>>>>> is Delta. This may be valid, but let's restart this as a discussion
>>>>> of a new feature then instead of a spec clarification.
>>>>>
>>>>> On Thu, Nov 12, 2026 at 1:07 PM Russell Spitzer <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> JB's two sentences are basically all the spec needs, and I think they
>>>>>> are required for any
>>>>>> implementation to be correct. The divergence comes from readers
>>>>>> treating "does this file use field IDs?"
>>>>>> as an all-or-nothing switch for the whole file.
>>>>>>
>>>>>> Iceberg writers don't produce files with only some field IDs (so the
>>>>>> Delta behavior is unexpected),
>>>>>> but if a reader encounters one, resolving each field independently,
>>>>>> with the file's ID taking precedence over the mapping, is unambiguous and
>>>>>> safe.
>>>>>>
>>>>>> The other cases raised are different: they describe a file where two
>>>>>> columns resolve to
>>>>>> the same ID, which is undefined behavior. It is like adding a name
>>>>>> mapping for a file with
>>>>>> columns A, B, C and mapping all three to ID 1 ({A -> 1, B -> 1, C ->
>>>>>> 1}). That is a user error,
>>>>>> not something the spec should require you to check for.
>>>>>>
>>>>>> In general we shouldn't tell implementations how to fail when they
>>>>>> encounter an illegal file.
>>>>>>
>>>>>> On Thu, Nov 12, 2026 at 2:36 AM Daksh Dave <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> I see Gang’s point about not trying to cover every malformed file in
>>>>>>> the spec. Could we keep this scoped to missing IDs where the mapping is
>>>>>>> unambiguous, and handle conflicting IDs separately?I see Gang’s point 
>>>>>>> about
>>>>>>> not trying to cover every malformed file in the spec. Could we keep this
>>>>>>> scoped to missing IDs where the mapping is unambiguous, and handle
>>>>>>> conflicting IDs separately?
>>>>>>>
>>>>>>> One thing I’d like to clarify is whether collision detection happens
>>>>>>> before column pruning. In JB’s example, column a has embedded ID 10
>>>>>>> and the mapping assigns the same ID to column b. Checking only the
>>>>>>> pruned schema could hide that conflict. Which physical column supplies
>>>>>>> field 10 shouldn’t depend on what else the query selects.
>>>>>>>
>>>>>>> For the verification fixture, I’d suggest testing both full and
>>>>>>> single-field projections, plus reordered physical columns, to check that
>>>>>>> resolution or rejection is consistent.
>>>>>>>
>>>>>>> For collisions, I’d lean toward failing the read, as JB suggested.
>>>>>>> Including both column paths and the conflicting ID in the error would 
>>>>>>> help
>>>>>>> diagnose an outdated mapping.
>>>>>>>
>>>>>>> On Thu, Nov 12, 2026 at 12:22 AM Gang Wu <[email protected]> wrote:
>>>>>>>
>>>>>>>> IMHO, handling files with partial or broken field IDs should remain
>>>>>>>> implementation-specific.
>>>>>>>>
>>>>>>>> Those files are produced outside of Iceberg's control. We can never
>>>>>>>> anticipate every way dirty files might conflict or miss IDs, or have
>>>>>>>> mismatched column names, and we cannot keep patching the spec to cover
>>>>>>>> every edge case.
>>>>>>>>
>>>>>>>> Best,
>>>>>>>> Gang
>>>>>>>>
>>>>>>>> On Thu, Nov 12, 2026 at 1:05 AM Jean-Baptiste Onofré <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Hi guys
>>>>>>>>>
>>>>>>>>> I checked the Java side, and it matches what you both described:
>>>>>>>>> - ParqueSchemaUtil.hasIds() returns true if any field at any depth
>>>>>>>>> has an ID, so a file with only top level IDs never uses the name 
>>>>>>>>> mapping.
>>>>>>>>> - It does the same per file check with ORCSchemaUtil.hasIds().
>>>>>>>>> - Avro already works per field. AvroSchemaUtil.getFieldId() uses
>>>>>>>>> the ID in the file when there is one and falls back to the mapping 
>>>>>>>>> when
>>>>>>>>> there is not.
>>>>>>>>>
>>>>>>>>> For the Java change, removing the hasIds() branch won't be enough.
>>>>>>>>> When a path matches, the Parquet and ORC ApplyNameMapping visitors 
>>>>>>>>> set the
>>>>>>>>> ID from the mapping and overwrite any ID already in the file. They 
>>>>>>>>> will
>>>>>>>>> need to keep an ID that's already there and only fill in the missing 
>>>>>>>>> ones.
>>>>>>>>> Otherwise, "never overrides an ID a writer recorded" is not true.
>>>>>>>>>
>>>>>>>>> I think the spec should cover a mapped ID that collides with an
>>>>>>>>> embedded ID on another column of the same file. I believe that can 
>>>>>>>>> happen
>>>>>>>>> with an outdated or hand written mapping, and then two columns 
>>>>>>>>> resolve to
>>>>>>>>> the same field ID. This case only exists with the per field reading,
>>>>>>>>> because today readers use either IDs or the mapping for the whole 
>>>>>>>>> file.
>>>>>>>>> Maybe we could make embedded ID wins and the conflicting mapped ID is
>>>>>>>>> ignored, so that column is treated as having no ID. Failing the read 
>>>>>>>>> would
>>>>>>>>> also be fine. Either way, we should be explicit in the spec.
>>>>>>>>>
>>>>>>>>> Something like that in the spec: "These mappings provide fallback
>>>>>>>>> field ids for fields in a data file that do not have a field id. A 
>>>>>>>>> field id
>>>>>>>>> stored in the data file always takes precedence over the name 
>>>>>>>>> mapping."
>>>>>>>>>
>>>>>>>>> Manu proposed a PR for the spec, I think it makes sense.
>>>>>>>>>
>>>>>>>>> Regards
>>>>>>>>> JB
>>>>>>>>>
>>>>>>>>> On Wed, Nov 11, 2026 at 3:55 PM Manu Zhang <
>>>>>>>>> [email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Sylwester,
>>>>>>>>>>
>>>>>>>>>> Thanks for raising this issue. I am also working to resolve the
>>>>>>>>>> inconsistency in iceberg-cpp [1][2].
>>>>>>>>>>
>>>>>>>>>> Your proposal looks reasonable, and it aligns with what the Avro
>>>>>>>>>> reader does in the Java implementation (whereas ORC follows the 
>>>>>>>>>> Parquet
>>>>>>>>>> rule). Whichever rule we decide to use, we should make sure it 
>>>>>>>>>> aligns with
>>>>>>>>>> the specification.
>>>>>>>>>>
>>>>>>>>>> Could you please open a spec PR so we can have a concrete
>>>>>>>>>> discussion there?
>>>>>>>>>>
>>>>>>>>>> [1] https://github.com/apache/iceberg-cpp/pull/1108
>>>>>>>>>> [2] https://github.com/apache/iceberg-cpp/pull/1109
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>> Manu
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Tue, Nov 3, 2026 at 8:20 AM Sylwester Lachiewicz via dev <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi all,
>>>>>>>>>>>
>>>>>>>>>>> The spec is ambiguous about Parquet data files that carry field
>>>>>>>>>>> IDs for some fields but not all, and no two of the four 
>>>>>>>>>>> implementations I
>>>>>>>>>>> checked resolve such a file the same way. I'd like to agree on one 
>>>>>>>>>>> reading
>>>>>>>>>>> and write it into the spec.
>>>>>>>>>>>
>>>>>>>>>>> Column Projection [1] says a reader should "use
>>>>>>>>>>> schema.name-mapping.default metadata to map field id to columns 
>>>>>>>>>>> without
>>>>>>>>>>> field id", which reads as per column. The paragraph that follows 
>>>>>>>>>>> says the
>>>>>>>>>>> mappings "provide fallback field ids to be used when a data file 
>>>>>>>>>>> does not
>>>>>>>>>>> contain field id information", which reads as per file. For a file 
>>>>>>>>>>> with no
>>>>>>>>>>> IDs at all, both readings agree. They diverge when only some fields 
>>>>>>>>>>> carry
>>>>>>>>>>> an ID.
>>>>>>>>>>>
>>>>>>>>>>> What the readers do today, on their main branches:
>>>>>>>>>>>
>>>>>>>>>>> - Java (ReadConf, ParquetSchemaUtil.HasIds): if any field in the
>>>>>>>>>>> file has an ID, the file is resolved by ID only and the name 
>>>>>>>>>>> mapping is not
>>>>>>>>>>> consulted.
>>>>>>>>>>> - PyIceberg (pyarrow_to_schema, _HasIds): IDs are used only if
>>>>>>>>>>> every field, including list elements and map keys and values, has 
>>>>>>>>>>> one;
>>>>>>>>>>> otherwise the whole file is resolved through the name mapping.
>>>>>>>>>>> - iceberg-rust (arrow/reader/pipeline.rs): the first top-level
>>>>>>>>>>> column decides; if it has an ID, the file is resolved by ID only.
>>>>>>>>>>> - iceberg-go (table/internal/parquet_files.go,
>>>>>>>>>>> pruneParquetSchema.fieldID): Parquet column pruning resolves per 
>>>>>>>>>>> field; an
>>>>>>>>>>> embedded ID wins, and the mapping fills in the fields without one.
>>>>>>>>>>>
>>>>>>>>>>> This happens in practice. Delta tables with column mapping,
>>>>>>>>>>> written without IcebergCompatV2, store IDs for top-level columns 
>>>>>>>>>>> but none
>>>>>>>>>>> for map keys and values or list elements. When such a table gets 
>>>>>>>>>>> Iceberg
>>>>>>>>>>> metadata [2], PyIceberg reads the map columns through the name 
>>>>>>>>>>> mapping,
>>>>>>>>>>> while the Java reader resolves by ID only and does not find the 
>>>>>>>>>>> map's key
>>>>>>>>>>> and value. The same table gives different results depending on the 
>>>>>>>>>>> reader.
>>>>>>>>>>>
>>>>>>>>>>> I propose the per-field reading, which matches the Column
>>>>>>>>>>> Projection rule: a field with an embedded ID is resolved by that 
>>>>>>>>>>> ID, and a
>>>>>>>>>>> field without one falls back to the name mapping. It never 
>>>>>>>>>>> overrides an ID
>>>>>>>>>>> a writer recorded, it changes nothing for files with full IDs or 
>>>>>>>>>>> with none,
>>>>>>>>>>> and it makes the partial case readable.
>>>>>>>>>>>
>>>>>>>>>>> If there is agreement, I can open a spec PR that clarifies the
>>>>>>>>>>> paragraph, and contribute a fixture to iceberg-verification [3]: a 
>>>>>>>>>>> file
>>>>>>>>>>> with IDs on its top-level fields only, as a companion to the base
>>>>>>>>>>> name-mapping table that issue covers.
>>>>>>>>>>>
>>>>>>>>>>> Is there a reason for the per-file behaviour that I'm missing,
>>>>>>>>>>> for example a correctness concern with mixing ID and name 
>>>>>>>>>>> resolution within
>>>>>>>>>>> one file?
>>>>>>>>>>>
>>>>>>>>>>> [1]
>>>>>>>>>>> https://www.google.com/url?q=https://iceberg.apache.org/spec/%23column-projection&source=gmail&ust=1793746430284000&sa=E
>>>>>>>>>>> [2]
>>>>>>>>>>> https://www.google.com/url?q=https://github.com/apache/incubator-xtable/issues/911&source=gmail&ust=1793746430284000&sa=E
>>>>>>>>>>> [3]
>>>>>>>>>>> https://www.google.com/url?q=https://github.com/apache/iceberg-verification/issues/14&source=gmail&ust=1793746430284000&sa=E
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> Sylwester
>>>>>>>>>>>
>>>>>>>>>>

Reply via email to