[iceberg] Leave the nanosecond refusal to the validator that knows the table - #9503
Merged
JingsongLi merged 1 commit intoSep 1, 2026
Merged
Conversation
Contributor
|
+1 |
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.
Purpose
Follow-up to #9455, which was right that the Iceberg mirror must not publish nanosecond timestamps — Paimon writes them as Parquet INT96, which Iceberg reads as microseconds. It added two defences, and I think
only one belongs.
SchemaValidation#validateIcebergTimestampPrecisionsis the right one: it refuses only when the table has Iceberg metadata enabled, and is registered by the same condition as the Iceberg publisher itself, sono table that can publish is missing it.
The other narrowed
IcebergDataField#toTypeStringfrom 3..9 to 3..6. That method only names the Iceberg type for a Paimon type — it has no table to ask, so it also refuses callers that never let Paimon writethe data, for whom the INT96 hazard does not arise. It also deleted the mapping of 7..9 to the v3 types
timestamp_nsandtimestamptz_ns, whichtoDatatypestill reads back as precision 9, so the class hasbeen claiming to read two names it stopped writing.
Whether nanoseconds may be published is a property of the table, not of the type. This restores the mapping and leaves the refusal to the validator.
TIMEhas the same shape but is left alone: Iceberg has no precision-carrying time type and the reverse mapping readstimeback as precision 3, so widening it there would trade a loud error for a silentprecision loss.
Tests
The three classes #9455 touched all pass —
IcebergCompatibilityTest48,SchemaManagerTest57,IcebergDataFieldTest31.IcebergDataFieldTestagain requires 7..9 to map to the v3 names.IcebergCompatibilityTest's commit-path refusal test now runs from aMethodSourceand additionally coversTIMESTAMP_WITH_LOCAL_TIME_ZONE(9)— the family this restores a mapping for, and previously uncovered there. It still passes, i.e. the mirror still refuses it.