-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Support time travel using temporal version in Delta Lake #24801
base: master
Are you sure you want to change the base?
Conversation
991211c
to
6cc05ca
Compare
You are my hero @chenjian2664 .. awesome job picking this up. |
2c9389f
to
e9d28b7
Compare
FROM example.testdb.customer_orders FOR TIMESTAMP AS OF TIMESTAMP '2022-03-23 09:59:29.803 Europe/Vienna'; | ||
``` | ||
|
||
You can use a date to specify a point a time in the past for using a snapshot of a table in a query. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mosabua please review docs part
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Outdated
Show resolved
Hide resolved
...elta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TemporalTimeTravelUtil.java
Show resolved
Hide resolved
...elta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TemporalTimeTravelUtil.java
Show resolved
Hide resolved
plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeBasic.java
Outdated
Show resolved
Hide resolved
|
||
```sql | ||
SELECT * | ||
FROM example.testdb.customer_orders FOR TIMESTAMP AS OF DATE '2022-03-23'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you pls add coverage for this use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It requires the commits in different date, do you have idea how to create it?
...elta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TemporalTimeTravelUtil.java
Outdated
Show resolved
Hide resolved
...elta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TemporalTimeTravelUtil.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Outdated
Show resolved
Hide resolved
...sts/src/main/java/io/trino/tests/product/deltalake/TestDeltaLakeTimeTravelCompatibility.java
Outdated
Show resolved
Hide resolved
...elta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TemporalTimeTravelUtil.java
Outdated
Show resolved
Hide resolved
...elta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TemporalTimeTravelUtil.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeConnectorTest.java
Show resolved
Hide resolved
...elta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TemporalTimeTravelUtil.java
Show resolved
Hide resolved
...sts/src/main/java/io/trino/tests/product/deltalake/TestDeltaLakeTimeTravelCompatibility.java
Outdated
Show resolved
Hide resolved
83c69f0
to
303f498
Compare
b9d11e4
to
612a6b6
Compare
private TemporalTimeTravelUtil() {} | ||
|
||
/** | ||
* Finds the latest version where the commit timestamp is less than or equal to the given `epochMillis`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main changes are here, refactor the helper method.
Would like to discuss about the maxLinearSearchSize
, shall we add it as a session property?
...st/resources/deltalake/v2_checkpoint_json_using_temporal/_delta_log/00000000000000000003.crc
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Outdated
Show resolved
Hide resolved
...elta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TemporalTimeTravelUtil.java
Outdated
Show resolved
Hide resolved
...trino-delta-lake/src/test/resources/deltalake/v2_checkpoint_parquet_using_temporal/README.md
Show resolved
Hide resolved
...elta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TemporalTimeTravelUtil.java
Outdated
Show resolved
Hide resolved
...elta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/TemporalTimeTravelUtil.java
Outdated
Show resolved
Hide resolved
36a55ce
to
9c2973f
Compare
9c2973f
to
06dda61
Compare
Description
Fix #21024
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: