Set Calendar type used for temporal types in ORC footer#26507
Merged
raunaqmorarka merged 1 commit intoOct 9, 2025
Merged
Conversation
f733ee2 to
cbb51f9
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for setting the calendar type in ORC file footers for temporal data types. When writing ORC files, the system now detects if temporal types (DATE, TIMESTAMP, TIMESTAMP_INSTANT) are present and sets the appropriate calendar metadata in the footer.
Key changes:
- Added
CalendarKindenum with three calendar types: UNKNOWN_CALENDAR, JULIAN_GREGORIAN, and PROLEPTIC_GREGORIAN - Enhanced Footer class to include optional calendar metadata
- Implemented logic to automatically set PROLEPTIC_GREGORIAN calendar when temporal types are detected during ORC writing
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| CalendarKind.java | New enum defining the three supported calendar types |
| Footer.java | Added optional calendar field to store calendar metadata |
| OrcMetadataReader.java | Added conversion from protobuf CalendarKind to Trino CalendarKind |
| OrcMetadataWriter.java | Added conversion from Trino CalendarKind to protobuf and footer writing logic |
| OrcType.java | Added constant set defining temporal ORC types |
| OrcWriter.java | Added logic to detect temporal types and set PROLEPTIC_GREGORIAN calendar |
| TestOrcWriter.java | Added comprehensive tests for calendar footer writing functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
cbb51f9 to
f181afe
Compare
martint
reviewed
Aug 28, 2025
Praveen2112
reviewed
Aug 28, 2025
ebyhr
reviewed
Sep 3, 2025
f181afe to
be4ac5f
Compare
Praveen2112
reviewed
Sep 6, 2025
ebyhr
reviewed
Sep 8, 2025
be4ac5f to
aa57717
Compare
ebyhr
reviewed
Sep 15, 2025
aa57717 to
bfcee07
Compare
chenjian2664
approved these changes
Sep 26, 2025
Contributor
chenjian2664
left a comment
There was a problem hiding this comment.
Everything looks good. The only point left is the decision around reading, which I expect should not significantly impact the PR’s structure
Contributor
Author
|
I'm planning to continue work on the issue this week. |
5d27751 to
daabbcf
Compare
raunaqmorarka
approved these changes
Oct 7, 2025
chenjian2664
approved these changes
Oct 8, 2025
daabbcf to
593e7f0
Compare
593e7f0 to
5c98822
Compare
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 aim of this change is to add to the ORC file's footer the calendar type that was used to represent the dates or timestamps. Trino uses the Proleptic Gregorian calendar. The motivation behind is compatibility of that ORC files written by Trino to be properly readable by other tools like Apache Hive that can read ORC files.
Follow-up issue: #26865
Doc entry #26874
Additional context and related issues
Release notes
( ) 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.
(x) Release notes are required, with the following suggested text: