Skip to content
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

Add syntax level BEFORE keyword support for time travel #21971

Open
gupteaj opened this issue Feb 21, 2024 · 2 comments
Open

Add syntax level BEFORE keyword support for time travel #21971

gupteaj opened this issue Feb 21, 2024 · 2 comments
Assignees
Labels
feature request iceberg Apache Iceberg related

Comments

@gupteaj
Copy link
Contributor

gupteaj commented Feb 21, 2024

Presto has added time travel feature for iceberg tables to allow point-in-time query using AS OF syntax.
This feature request will allow presto to query table state before a specific snapshot id or timestamp.

Presto issue for time travel feature - #20495

Expected Behavior or Use Case

// Return table data for tab1 before snapshot id 8772871542276440693
select * from tab1 FOR SYSTEM_VERSION BEFORE 8772871542276440693;

// Return table data for tab1 before '2023-08-17 13:29:46.822 America/Los_Angeles'
select * from tab1 FOR SYSTEM_TIME BEFORE TIMESTAMP '2023-08-17 13:29:46.822 America/Los_Angeles';

Context

Snowflake provides a BEFORE clause for time travel queries. When used in a query, this clause is specified in the FROM clause immediately after the table name. It determines the point in the past from which historical data is requested for the object. The AT keyword includes changes made by a statement or transaction with a timestamp equal to the specified parameter, while the BEFORE keyword refers to a point immediately preceding the specified parameter.

IBM Netezza supports BEFORE clause similar to Snowflake.

References -
Snowflake - https://docs.snowflake.com/en/sql-reference/constructs/at-before
IBM Netezza - https://cloud.ibm.com/docs/netezza?topic=netezza-runningqueries_tt#before_tt

@gupteaj gupteaj added feature request iceberg Apache Iceberg related labels Feb 21, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Unprioritized in Iceberg Support Feb 21, 2024
@tdcmeehan tdcmeehan moved this from 🆕 Unprioritized to 📋 Prioritized Backlog in Iceberg Support Feb 27, 2024
@gupteaj gupteaj self-assigned this Mar 27, 2024
@gupteaj gupteaj moved this from 📋 Prioritized Backlog to 🏗 In progress in Iceberg Support Mar 27, 2024
@gupteaj
Copy link
Contributor Author

gupteaj commented Apr 29, 2024

PR for BEFORE syntax engine side changes - #22631

@gupteaj
Copy link
Contributor Author

gupteaj commented May 28, 2024

Connector changes PR : #22851

@gupteaj gupteaj moved this from 🏗 In progress to 👀 Review in Iceberg Support May 28, 2024
@gupteaj gupteaj moved this from 👀 Review to ✅ Done in Iceberg Support Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request iceberg Apache Iceberg related
Projects
Status: Done
Development

No branches or pull requests

1 participant