Repository navigation
Conversation
The schema sync collects its updates in a map by field id and put every dropped column under the key 0, so that drops run first. When one sync removed several columns, each drop replaced the one before it in the map and a single column was dropped. The others stayed in the Iceberg schema and were dropped one per later sync. A drop is now keyed by the negative field id of its column, which still runs the drops first and keeps one entry per column. A new test removes two columns in one sync and expects both to be dropped.
A table published through the Iceberg table format listed _hoodie_commit_time, _hoodie_commit_seqno, _hoodie_record_key, _hoodie_partition_path and _hoodie_file_name as its first five columns. Iceberg readers saw columns no Iceberg writer has, and a row that a rewrite carried over unchanged differed from its earlier version in _hoodie_file_name, so Iceberg's changelog view reported it as updated. The table format now describes the table without the meta columns. HudiTableExtractor takes a flag for it, which only the table format sets, so every other conversion from Hudi keeps the columns. There is no setting, since nothing in the format reads the columns through the Iceberg schema: stats, partition values, positional deletes and the row lineage checks read the base files or Hudi's own schema. The base files still store the columns. Iceberg readers skip them, as Hudi's base files carry no field ids and are read through the table's default name mapping, which maps the columns of the schema and, at format version 3, the row lineage columns under their reserved ids. The name mapping was already set by the first commit of a table and set again by a commit that finds it missing, without any setting. A mapping set again was built from the converted source schema, though. That schema numbers the columns of a source without field ids in order, which differs from the field ids of the table once a column was dropped or added, so the columns after it were mapped to the ids of other columns. The mapping is now built from the schema of the table, and the schema update that follows maintains it. A reader that ignores the name mapping, as Iceberg's IcebergGenerics does, resolves the columns of a file without field ids by position. It used to read the right top-level columns by coincidence and now reads _hoodie_commit_time as the first column of the table. A test pins this limit. The new tests read a copy-on-write table and a merge-on-read table with deletion vectors through Spark, and check the name mapping after the first commit at format versions 2 and 3, after its removal, after added top-level and nested columns, and after two columns dropped in one commit followed by an added column, as well as the row lineage columns of a rewritten base file. The test helpers that read the meta columns through Iceberg now read them through Hudi or from the base files.
yihua
force-pushed
the
ptf-review-row-lineage
branch
from
November 24, 2026 20:56
81f8862 to
2532a6e
Compare
yihua
force-pushed
the
ptf-review-meta-columns-out-of-schema
branch
from
November 24, 2026 20:56
2a807b6 to
fcb0200
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important Read
Issue: apache#1044, part of apache#722. Based on #13; review that first. The change is already on
iceberg-v3-ptf-poc, which is not meant to land as one PR, so this PR carries one area of it for review.What is the purpose of the pull request
The Iceberg schema of a table published through the table format no longer lists the five
_hoodie_*columns; the base files still store them and Iceberg readers skip them through the table's name mapping. The name mapping a commit sets again is built from the table's schema, so the field ids stay right after columns were dropped or added.Brief change log
HudiTableExtractortakes a flag to leave the meta columns out, which only the table format sets.IcebergConversionTargetrebuilds a missing name mapping from the table schema.Known limitations:
IcebergGenerics, now reads the wrong columns, since the base files have no field ids and start with the meta columns.Verify this pull request
This change added tests and can be verified as follows:
ITIcebergMetaColumnschecks that the Iceberg schema has no meta columns while the base files keep them, that Spark, the Parquet reader and Iceberg's changelog read the right columns through the name mapping, that a restored name mapping keeps the table's field ids after columns were dropped and added, and pins whatIcebergGenerics, which ignores the name mapping, reads.TestHudiTableExtractorandTestIcebergSynccover the flag and the mapping.xtable-coreunit tests and 9xtable-coreIceberg ITs pass, and the Iceberg table format's 43 unit tests and 136 ITs pass (1 skipped).