Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
…ding NULL (apache#68003) ### What problem does this PR solve? Problem Summary: A table property `schema.name-mapping.default` that is present but malformed was silently degraded: the FE caught the parse failure and rebuilt a "current schema" mapping, which is authoritative, so data files without Iceberg field ids could only be resolved by their current column names. After a column rename the old physical column is then unmatched and V2 semantics materializes NULL for it - the query succeeds but historical values are lost. When a name was reused the same fallback could even bind the wrong physical column. Iceberg readers do not behave that way: Spark's `BaseReader` parses `schema.name-mapping.default` while constructing the reader and fails the query on a malformed value (`IllegalArgumentException`/`UncheckedIOException`), regardless of whether the data files carry field ids. This PR removes the current-schema fallback and reports the metadata fault instead: `IcebergUtils.getNameMapping` now throws a `UserException` naming the table, the property, the root cause and the remediation. Metadata (system) table scans are excluded because they never resolve physical data columns by name. ### Behavior changes Before this change: - A malformed `schema.name-mapping.default` was rewritten into current-schema aliases, so ID-less files were read by current column name (renamed columns returned NULL). - No user visible error was raised; only a FE warning was logged. After this change: - A malformed `schema.name-mapping.default` fails the query with an explicit metadata error. - Queries that only read Iceberg metadata tables (for example `tbl$snapshots`) keep working. ### Check List (For Author) - Test - [x] Unit Test - Behavior changed: - [x] Yes. - Does this need documentation? - [x] No.
hubgeter
force-pushed
the
fix/iceberg-invalid-name-mapping-branch-4.1
branch
from
September 15, 2026 07:00
5db8aa0 to
8dabec7
Compare
15 tasks
Contributor
Author
|
run buildall |
hubgeter
marked this pull request as draft
September 15, 2026 10:17
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.
What problem does this PR solve?
Problem Summary:
bp #68004
When the Iceberg table property
schema.name-mapping.defaultis present but malformed, the FE caught the parse failure and rebuilt a "current schema" name mapping, which is authoritative. Data files that do not carry Iceberg field ids could then only be resolved by their current column names. After a column rename the old physical column is unmatched, V2 semantics materializes NULL for it, and the query succeeds with historical values lost. If the old name was later reused by another column, the fallback could even bind the wrong physical column.Iceberg itself does not degrade like this: Spark's
BaseReaderparsesschema.name-mapping.defaultwhile constructing the reader and fails the query for a malformed value (IllegalArgumentException/UncheckedIOException), regardless of whether the data files carry field ids.This PR removes the current-schema fallback and reports the metadata fault instead.
IcebergUtils.getNameMappingnow throws aUserExceptionthat names the table, the property, the root cause and the remediation, so the failure is visible instead of silently returning NULL. Metadata (system) table scans are excluded, because they never resolve physical data columns by name.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)