-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Enhancement](delete) eliminate reading the old values of non-key columns for delete stmt #22270
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
regression-test/data/nereids_p0/delete/partial_update_delete.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| 1 | ||
| 2 | ||
| 3 |
3 changes: 3 additions & 0 deletions
3
regression-test/data/unique_with_mow_p0/partial_update/partial_update_delete.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| 1 | ||
| 2 | ||
| 3 |
43 changes: 43 additions & 0 deletions
43
regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_delete.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| -- This file is automatically generated. You should know what you did if you want to edit this | ||
| -- !sql -- | ||
| 1 1 1 1 1 | ||
| 2 2 2 2 2 | ||
| 3 3 3 3 3 | ||
| 4 4 4 4 4 | ||
| 5 5 5 5 5 | ||
|
|
||
| -- !sql -- | ||
| 4 4 4 4 4 | ||
| 5 5 5 5 5 | ||
|
|
||
| -- !with_delete_sign -- | ||
| 1 \N \N \N \N 1 | ||
| 1 1 1 1 1 0 | ||
| 2 \N \N \N \N 1 | ||
| 2 2 2 2 2 0 | ||
| 3 \N \N \N \N 1 | ||
| 3 3 3 3 3 0 | ||
| 4 4 4 4 4 0 | ||
| 5 5 5 5 5 0 | ||
|
|
||
| -- !sql -- | ||
| 1 1 1 1 1 | ||
| 2 2 2 2 2 | ||
| 3 3 3 3 3 | ||
| 4 4 4 4 4 | ||
| 5 5 5 5 5 | ||
|
|
||
| -- !sql -- | ||
| 4 4 4 4 4 | ||
| 5 5 5 5 5 | ||
|
|
||
| -- !sql -- | ||
| 1 \N \N \N \N 1 | ||
| 1 1 1 1 1 0 | ||
| 2 \N \N \N \N 1 | ||
| 2 2 2 2 2 0 | ||
| 3 \N \N \N \N 1 | ||
| 3 3 3 3 3 0 | ||
| 4 4 4 4 4 0 | ||
| 5 5 5 5 5 0 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_delete.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| suite('test_partial_update_delete') { | ||
| sql 'set enable_nereids_planner=false' | ||
| sql "set experimental_enable_nereids_planner=false;" | ||
| sql 'set enable_nereids_dml=false' | ||
|
|
||
| def tableName1 = "test_partial_update_delete1" | ||
| sql "DROP TABLE IF EXISTS ${tableName1};" | ||
| sql """ CREATE TABLE IF NOT EXISTS ${tableName1} ( | ||
| `k1` int NOT NULL, | ||
| `c1` int, | ||
| `c2` int, | ||
| `c3` int, | ||
| `c4` int | ||
| )UNIQUE KEY(k1) | ||
| DISTRIBUTED BY HASH(k1) BUCKETS 1 | ||
| PROPERTIES ( | ||
| "enable_unique_key_merge_on_write" = "true", | ||
| "disable_auto_compaction" = "true", | ||
| "replication_num" = "1" | ||
| );""" | ||
|
|
||
| def tableName2 = "test_partial_update_delete2" | ||
| sql "DROP TABLE IF EXISTS ${tableName2};" | ||
| sql """ CREATE TABLE IF NOT EXISTS ${tableName2} ( | ||
| `k` BIGINT NULL | ||
| ) UNIQUE KEY(k) | ||
| DISTRIBUTED BY HASH(k) BUCKETS 1 | ||
| PROPERTIES ( | ||
| "enable_unique_key_merge_on_write" = "true", | ||
| "disable_auto_compaction" = "true", | ||
| "replication_num" = "1" | ||
| );""" | ||
|
|
||
| sql "insert into ${tableName1} values(1,1,1,1,1),(2,2,2,2,2),(3,3,3,3,3),(4,4,4,4,4),(5,5,5,5,5);" | ||
| qt_sql "select * from ${tableName1} order by k1;" | ||
| sql "insert into ${tableName2} values(1),(2),(3);" | ||
| sql "delete from ${tableName1} A using ${tableName2} B where A.k1=B.k;" | ||
| qt_sql "select * from ${tableName1} order by k1;" | ||
| sql "set skip_delete_sign=true;" | ||
| sql "set skip_storage_engine_merge=true;" | ||
| sql "set skip_delete_bitmap=true;" | ||
| qt_with_delete_sign "select k1,c1,c2,c3,c4,__DORIS_DELETE_SIGN__ from ${tableName1} order by k1,c1,c2,c3,c4,__DORIS_DELETE_SIGN__;" | ||
|
|
||
| sql "set skip_delete_sign=false;" | ||
| sql "set skip_storage_engine_merge=false;" | ||
| sql "set skip_delete_bitmap=false;" | ||
| def tableName3 = "test_partial_update_delete3" | ||
| sql "DROP TABLE IF EXISTS ${tableName3};" | ||
| sql """ CREATE TABLE IF NOT EXISTS ${tableName3} ( | ||
| `k1` int NOT NULL, | ||
| `c1` int, | ||
| `c2` int, | ||
| `c3` int, | ||
| `c4` int | ||
| )UNIQUE KEY(k1) | ||
| DISTRIBUTED BY HASH(k1) BUCKETS 1 | ||
| PROPERTIES ( | ||
| "enable_unique_key_merge_on_write" = "true", | ||
| "disable_auto_compaction" = "true", | ||
| "replication_num" = "1" | ||
| );""" | ||
| sql "insert into ${tableName3} values(1,1,1,1,1),(2,2,2,2,2),(3,3,3,3,3),(4,4,4,4,4),(5,5,5,5,5);" | ||
| qt_sql "select k1,c1,c2,c3,c4 from ${tableName3} order by k1,c1,c2,c3,c4;" | ||
| streamLoad { | ||
| table "${tableName3}" | ||
|
|
||
| set 'column_separator', ',' | ||
| set 'format', 'csv' | ||
| set 'columns', 'k1' | ||
| set 'partial_colunms', 'true' | ||
| set 'merge_type', 'DELETE' | ||
|
|
||
| file 'partial_update_delete.csv' | ||
| time 10000 | ||
| } | ||
| qt_sql "select k1,c1,c2,c3,c4 from ${tableName3} order by k1,c1,c2,c3,c4;" | ||
| sql "set skip_delete_sign=true;" | ||
| sql "set skip_storage_engine_merge=true;" | ||
| sql "set skip_delete_bitmap=true;" | ||
| qt_sql "select k1,c1,c2,c3,c4,__DORIS_DELETE_SIGN__ from ${tableName3} order by k1,c1,c2,c3,c4,__DORIS_DELETE_SIGN__;" | ||
|
|
||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.