Skip to content

Fix incorrect rounding for instant_micros in ORC#12804

Merged
martint merged 1 commit intotrinodb:masterfrom
martint:orc-timestamptz
Jun 13, 2022
Merged

Fix incorrect rounding for instant_micros in ORC#12804
martint merged 1 commit intotrinodb:masterfrom
martint:orc-timestamptz

Conversation

@martint
Copy link
Copy Markdown
Member

@martint martint commented Jun 11, 2022

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.

Is this change a fix, improvement, new feature, refactoring, or other?

Bug fix

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

Connector: Iceberg and Hive

How would you describe this change to a non-technical end user or system administrator?

Documentation

(x) No documentation is needed.

Release notes

# Iceberg, Hive
* Fix potential query failure when reading `timestamp(6) with time zone` values. ({issue}`12804`)

@cla-bot cla-bot bot added the cla-signed label Jun 11, 2022
@martint martint requested review from electrum and findepi June 11, 2022 04:01
@martint martint added the bug label Jun 11, 2022
@findepi
Copy link
Copy Markdown
Member

findepi commented Jun 11, 2022

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.

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.
@martint
Copy link
Copy Markdown
Member Author

martint commented Jun 13, 2022

@findepi, added a test. Please take a look.

@martint martint requested a review from findepi June 13, 2022 16:32
@findepi
Copy link
Copy Markdown
Member

findepi commented Jun 13, 2022

@findepi, added a test. Please take a look.

thanks!

@martint martint merged commit f2cee44 into trinodb:master Jun 13, 2022
@github-actions github-actions bot added this to the 386 milestone Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants