-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add support for pruning splits using metadata columns in Delta Lake #25376
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
Conversation
afe9cba to
f77b4b2
Compare
| public void testOptimizeWithFileModifiedTimeColumn() | ||
| throws Exception | ||
| { | ||
| try (TestTable table = newTrinoTable("test_optimize_with_file_modified_time_", "(id INT)")) { |
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.
The tests are copied from BaseIcebergConnectorTest with very small changes:
- using MILLISECONDS.sleep(1);
- adapt the result
getActiveFiles - using
newTrinoTableto create test table
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/DeltaLakeSplitManager.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeSplitManager.java
Outdated
Show resolved
Hide resolved
f77b4b2 to
f82ffa5
Compare
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Outdated
Show resolved
Hide resolved
f82ffa5 to
b165d68
Compare
plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeConnectorTest.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeConnectorTest.java
Outdated
Show resolved
Hide resolved
48fac61 to
1923e8f
Compare
1923e8f to
36b985c
Compare
|
@chenjian2664 Could you confirm CI failure? |
36b985c to
47d3648
Compare
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeSplitManager.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeConnectorTest.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeConnectorTest.java
Outdated
Show resolved
Hide resolved
3481036 to
b1008c0
Compare
ebyhr
left a comment
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.
This PR still has a correctness issue on DELETE operation. You can reproduce by the following steps:
CREATE TABLE test(a int);
INSERT INTO test VALUES 1;
INSERT INTO test VALUES 2;
SELECT "$path" FROM test;
DELETE FROM test WHERE "$path" = 'x'; -- removes all rows
TABLE test;
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/util/DeltaLakeUtil.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeColumnHandle.java
Outdated
Show resolved
Hide resolved
Extracted `partitionMatchesPredicate` from `DeltaLakeSplitManager` into a new utility class `DeltaLakeDomains`
144888b to
ef439e4
Compare
Co-Authored-By: Marius Grama <findinpath@gmail.com>
The `$path` column is already used for pruning splits in DeltaLakeSplitManager, This commit removes the `$path` domain from `remainingFilter` of the filter pushdown result Co-Authored-By: Marius Grama <findinpath@gmail.com>
ef439e4 to
26d17a1
Compare
Co-Authored-By: Marius Grama <findinpath@gmail.com>
|
(Fixed a small typo) |
Introduces handling and pushdown of the metadata columns('$file_modified_time', '$path', '$file_size') in Delta Lake
Description
Closes #25369
Release notes