Skip to content

Support Iceberg version travel by reference name#19111

Merged
ebyhr merged 1 commit intotrinodb:masterfrom
amogh-jahagirdar:time-travel-ref
Sep 25, 2023
Merged

Support Iceberg version travel by reference name#19111
ebyhr merged 1 commit intotrinodb:masterfrom
amogh-jahagirdar:time-travel-ref

Conversation

@amogh-jahagirdar
Copy link
Copy Markdown
Contributor

@amogh-jahagirdar amogh-jahagirdar commented Sep 20, 2023

Description

Support Iceberg version travel by reference name.

Note: This is a rebased version of #15646. I addressed some conflicts, added an additional test, and cleaned up a nit. @jackye1995 was the original author of this PR, I just marked myself as a co-author (let me know what is the practice followed in the Trino community).

Additional context and related issues

SELECT * FROM table AS OF VERSION 'tag-name'

Release notes

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

Copy link
Copy Markdown
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

The original PR was reviewed and approved by @alexjo2144 , @findinpath , and @ebyhr . I reviewed for differences, wording on user facing messages and beyond. All looks good to me.

Copy link
Copy Markdown
Member

@alexjo2144 alexjo2144 left a comment

Choose a reason for hiding this comment

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

Still looks good to me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you have a plan to support CharType in follow-up?

Copy link
Copy Markdown
Contributor Author

@amogh-jahagirdar amogh-jahagirdar Sep 21, 2023

Choose a reason for hiding this comment

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

I did not originally, but I don't see why we wouldn't want to support it. Happy to address in a follow on though if possible. Should I create a tracking issue for follow up or do you recommend I just address it here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

file an issue + add TODO comment here linking to it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TestIcebergReadVersionedTable seems a better class for testing time travel. (No need to change this PR because it requires more work)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure sounds good, when I follow up with CharType support #19111 (comment) I can move all the test in a separate commit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a little confused by this last sentence. Could you elaborate on that?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

apache/iceberg#5364 (comment)

@amogh-jahagirdar, let's try to do a slightly condensed version of this comment to explain how our behavior is driven by a retention policy and is not a direct parallel to git branching behavior.

Later, I want to take this comment and elaborate with some visuals to explain this behavior in more detail, and we can shorten the explanation and link to the Iceberg docs at that time.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@amogh-jahagirdar, I spoke with @ebyhr on the side and he's just gonna remove that line for now and you and I should follow up and make an easy reference point in the Iceberg docs to point to about this.

apache/iceberg#8638

Co-authored-by: Amogh Jahagirdar <amogh@tabular.io>
if (ref == null) {
throw new TrinoException(INVALID_ARGUMENTS, "Cannot find snapshot with reference name: " + refName);
}
snapshotId = ref.snapshotId();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

From this implementation, it seems that there is no distinction between branch and tag queries in trino, and both are used to query a fixed snapshot ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

9 participants