Skip to content

Conversation

marcinsbd
Copy link
Contributor

@marcinsbd marcinsbd commented Oct 8, 2025

Description

The follow up of the #26507
It's related to the #26865

Additional context and related issues

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`)

Summary by Sourcery

Documentation:

  • Note that Trino does not support Calendar entries in ORC file metadata and thus always treats dates and timestamps as Proleptic Gregorian, causing legacy data inconsistencies.

@cla-bot cla-bot bot added the cla-signed label Oct 8, 2025
Copy link

sourcery-ai bot commented Oct 8, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR enhances the ORC file-formats documentation by adding a known limitation about Trino’s ORC reader treating dates and timestamps using the Proleptic Gregorian Calendar due to missing calendar metadata support.

File-Level Changes

Change Details Files
Document ORC reader calendar metadata limitation
  • Add a 'Known limitations' section to file-formats.md
  • Explain absence of Calendar entry support in ORC metadata
  • Describe Proleptic Gregorian fallback and its impact on legacy dates/timestamps
docs/src/main/sphinx/object-storage/file-formats.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `docs/src/main/sphinx/object-storage/file-formats.md:35` </location>
<code_context>
 configured.

+Known limitations:
+Currently, Trino does not support Calendar entry in Orc file metadata. As a results Trino always treats dates and timestamps as values written using Proleptic Gregorian Calendar. This causes incorrect reads of legacy dates and timestamps that were written using Hybrid Calendar.
+
 (parquet-format-configuration)=
</code_context>

<issue_to_address>
**issue (typo):** Typo: 'As a results' should be 'As a result'.

Please update the phrase for correct grammar.

```suggestion
Currently, Trino does not support Calendar entry in Orc file metadata. As a result Trino always treats dates and timestamps as values written using Proleptic Gregorian Calendar. This causes incorrect reads of legacy dates and timestamps that were written using Hybrid Calendar.
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@marcinsbd marcinsbd force-pushed the marcinsbd/doc-update-orc branch from 014b2dd to d04570d Compare October 8, 2025 08:02
@findepi findepi changed the title Add a known limitation of Orc reader to docs. Document Calendar ORC metadata limitation Oct 8, 2025
@marcinsbd marcinsbd force-pushed the marcinsbd/doc-update-orc branch from d04570d to 0b4f585 Compare October 9, 2025 08:42
@marcinsbd marcinsbd force-pushed the marcinsbd/doc-update-orc branch from 4f4b7d1 to 0d7cfd3 Compare October 9, 2025 10:17
@marcinsbd
Copy link
Contributor Author

@mosabua can you take a look?

@marcinsbd marcinsbd requested a review from findepi October 10, 2025 07:40
Limitations:
[Trino ignores Calendar entry in ORC file metadata.](https://github.com/trinodb/trino/issues/26865)
As a result Trino always treats dates and timestamps as values written using
proleptic Gregorian calendar. This causes incorrect values read when reading
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
proleptic Gregorian calendar. This causes incorrect values read when reading
Gregorian calendar. This causes incorrect values when reading

Copy link
Member

Choose a reason for hiding this comment

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

  • proleptic is an important word, we should keep it

  • "This causes incorrect values when reading" reads as missing something.
    Incorrect values where? does the file gets broken, changed or malformed when we try to read it? or only the values reconstructed in computer memory are wrong?

[Trino ignores Calendar entry in ORC file metadata.](https://github.com/trinodb/trino/issues/26865)
As a result Trino always treats dates and timestamps as values written using
proleptic Gregorian calendar. This causes incorrect values read when reading
date/time values before Oct 15, 1582 that were written using hybrid
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
date/time values before Oct 15, 1582 that were written using hybrid
values before Oct 15, 1582 that were written using hybrid

Copy link
Member

Choose a reason for hiding this comment

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

we can remove "date/time", but then we need to indicate which types does this apply to.
@mosabua how would you want to indicate this?

@findepi findepi requested a review from mosabua October 13, 2025 12:13
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.

5 participants