Skip to content

Added support for the timestamp type for statistics in trino-hive connector #26338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anton-kutuzov
Copy link
Contributor

Description

Added support for the timestamp type in statistics calculation.
To maintain compatibility with Hive statistics, the computed min and max values are truncated to seconds during write by dividing by MICROSECONDS_PER_SECOND, using floor for min and ceil for max to avoid losing millisecond precision. When reading, values are converted back to Trino format by multiplying by MICROSECONDS_PER_SECOND.

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Aug 4, 2025
@github-actions github-actions bot added the hive Hive connector label Aug 4, 2025
@anton-kutuzov anton-kutuzov changed the title Added support for the timestamp type for statistics Added support for the timestamp type for statistics in trino-hive connector Aug 4, 2025
@anton-kutuzov anton-kutuzov force-pushed the add_suporting_tymestamp_in_statistics branch from d916970 to f8e8a57 Compare August 4, 2025 17:27
@anton-kutuzov anton-kutuzov requested review from dain and findepi August 6, 2025 06:16
Copy link
Member

@ebyhr ebyhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change fix #26214?

@anton-kutuzov
Copy link
Contributor Author

anton-kutuzov commented Aug 11, 2025

Does this change fix #26214?

Unfortunately no, because implementation in this PR is for hive metastore 3, because in 3-rd version of hive metastore the timespamp is stored as long, In the 4-th version the additional type for timestamp was added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed hive Hive connector
Development

Successfully merging this pull request may close these issues.

2 participants