Fix incorrect rounding for instant_micros in ORC#12804
Merged
martint merged 1 commit intotrinodb:masterfrom Jun 13, 2022
Merged
Fix incorrect rounding for instant_micros in ORC#12804martint merged 1 commit intotrinodb:masterfrom
martint merged 1 commit intotrinodb:masterfrom
Conversation
dain
approved these changes
Jun 11, 2022
findepi
approved these changes
Jun 11, 2022
lib/trino-orc/src/main/java/io/trino/orc/reader/TimestampColumnReader.java
Outdated
Show resolved
Hide resolved
Member
Can it happen if we write with Hive with nanosecond precision and read back with microsecond precision? |
The picosecond of millisecond fraction can round up to a whole millisecond. This needs to be accounted for by adjusting the millisecondEpoch portion.
Member
Author
|
@findepi, added a test. Please take a look. |
findepi
approved these changes
Jun 13, 2022
Member
thanks! |
dain
approved these changes
Jun 13, 2022
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.
Description
The picosecond of millisecond fraction can round up to a whole
millisecond. This needs to be accounted for by adjusting the
millisecondEpoch portion.
Not sure how to test this, as I don't think we have infrastructure for generating ORC files with the instant_micros values that will trigger this issue.
Bug fix
Connector: Iceberg and Hive
Documentation
(x) No documentation is needed.
Release notes