Push down DELETE for enforceable filters on Delta Lake#18332
Push down DELETE for enforceable filters on Delta Lake#18332ebyhr merged 3 commits intotrinodb:masterfrom
Conversation
There was a problem hiding this comment.
This change is in sync with
I'd benefit from a suggestion in which utility class could i extract the method for creating the file name.
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Outdated
Show resolved
Hide resolved
6261a7b to
cb8a04f
Compare
|
As agreed with @findepi , it is rather unusual to deal with |
cb8a04f to
958e634
Compare
...no-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeExecuteDeleteTableHandle.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Outdated
Show resolved
Hide resolved
958e634 to
b791cd1
Compare
de468d5 to
31f088f
Compare
31f088f to
fd8e62a
Compare
There was a problem hiding this comment.
I'm just following the same pattern as the one used for UPDATE/DELETE/MERGE statements in Delta Lake. See #15763
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
plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeConnectorTest.java
Outdated
Show resolved
Hide resolved
...in/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeFileOperations.java
Outdated
Show resolved
Hide resolved
...t-tests/src/main/java/io/trino/tests/product/deltalake/TestDeltaLakeDeleteCompatibility.java
Outdated
Show resolved
Hide resolved
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java
Outdated
Show resolved
Hide resolved
e11f841 to
36b1b96
Compare
...in/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeFileOperations.java
Outdated
Show resolved
Hide resolved
|
Rebasing on |
7c22b5b to
12e8d36
Compare
|
@pajaks & @alexjo2144 AC. Please review again the PR. |
plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.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/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
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
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
...t-tests/src/main/java/io/trino/tests/product/deltalake/TestDeltaLakeDeleteCompatibility.java
Outdated
Show resolved
Hide resolved
12e8d36 to
c2128d4
Compare
|
Thank you everybody for the valuable feedback. |
adaf4e7 to
4dc908c
Compare
Perform DELETE only on the metadata of the Delta Lake table when the delete filter does not touch any data columns. Sample queries affected by this enhancement are: ``` DELETE FROM table DELETE FROM table WHERE true DELETE FROM partitioned_table WHERE part1=value1 AND part2=value2 DELETE FROM partitioned_table WHERE part2=value2 ``` Given that this operation is performed only on the metadata layer, when there are `add` file entries in the transaction log of the table without statistics containing number of records, then number of deleted records will not be returned.
4dc908c to
29ba6d3
Compare
|
Pushed small changes to fix CI failure. |
Description
Perform DELETE only on the metadata of the Delta Lake
table when the delete filter does not touch any data
columns.
Sample queries affected by this enhancement are:
Fixes #18331
The operation will not be performed on the metadata layer when
there are
addfile entries in the transaction log of the tablewithout statistics containing number of records.
Additional context and related issues
Without
DELETEpushdownWith
DELETEpushdowntldr; before 103 s after 1.8 s
Release notes
(x) Release notes are required, with the following suggested text: