[iceberg] Fix TIMESTAMP(3) bound decoding in IcebergConversions#8231
Merged
JingsongLi merged 1 commit intoJun 14, 2026
Merged
Conversation
…pFromBytes For precision == 3, timestampFromBytes decoded the manifest INT64 value with Timestamp.fromEpochMillis, treating it as milliseconds. The Iceberg manifest always stores timestamps as microseconds (INT64 MICROS per spec §4.1.7). The precision 4-6 path already used fromMicros correctly. Use fromMicros for all supported precisions and update test cases to supply microsecond values for the precision-3 assertions.
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.
Problem
IcebergConversions.timestampFromBytesdecoded the manifest INT64 bound withTimestamp.fromEpochMillisforprecision == 3, but the Iceberg manifest always stores timestamps as INT64 microseconds regardless of precision. For precision 4–6 the same method already usedTimestamp.fromMicroscorrectly, making the precision-3 branch inconsistent.The practical consequence is that reading a precision-3 timestamp bound back from a manifest returns a value 1000× too large, and if that inflated value is subsequently passed through
Timestamp.toMicros()it causesArithmeticException: long overflowinMath.multiplyExact.Fix
Use
Timestamp.fromMicrosfor all supported precisions intimestampFromBytes.Changes
IcebergConversions.java:timestampFromBytesusesfromMicrosfor all precisions (removes theprecision == 3special-case)IcebergConversionsTimestampTest.java:provideTimestampToPaimonCasesupdated to supply microsecond values for the precision-3 test cases