diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DeleteFromCommand.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DeleteFromCommand.java index 0778765f0bd488..bbedc4fe8d3cde 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DeleteFromCommand.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DeleteFromCommand.java @@ -400,26 +400,32 @@ public LogicalPlan completeQueryPlan(ConnectContext ctx, LogicalPlan logicalQuer List cols = Lists.newArrayList(); boolean isMow = targetTable.getEnableUniqueKeyMergeOnWrite(); String tableName = tableAlias != null ? tableAlias : targetTable.getName(); + boolean hasClusterKey = targetTable.getBaseSchema().stream().anyMatch(Column::isClusterKey); + // currently cluster key doesn't support partial update, so we can't convert + // a delete stmt to partial update load if the table has cluster key for (Column column : targetTable.getFullSchema()) { + NamedExpression expr = null; if (column.getName().equalsIgnoreCase(Column.DELETE_SIGN)) { - selectLists.add(new UnboundAlias(new TinyIntLiteral(((byte) 1)), Column.DELETE_SIGN)); + expr = new UnboundAlias(new TinyIntLiteral(((byte) 1)), Column.DELETE_SIGN); } else if (column.getName().equalsIgnoreCase(Column.SEQUENCE_COL) && targetTable.getSequenceMapCol() != null) { - selectLists.add(new UnboundSlot(tableName, targetTable.getSequenceMapCol())); + expr = new UnboundSlot(tableName, targetTable.getSequenceMapCol()); } else if (column.isKey()) { - selectLists.add(new UnboundSlot(tableName, column.getName())); + expr = new UnboundSlot(tableName, column.getName()); } else if (!isMow && (!column.isVisible() || (!column.isAllowNull() && !column.hasDefaultValue()))) { - selectLists.add(new UnboundSlot(tableName, column.getName())); + expr = new UnboundSlot(tableName, column.getName()); + } else if (hasClusterKey) { + expr = new UnboundSlot(tableName, column.getName()); } else { - selectLists.add(new UnboundSlot(tableName, column.getName())); + continue; } + selectLists.add(expr); cols.add(column.getName()); } logicalQuery = new LogicalProject<>(selectLists, logicalQuery); - boolean isPartialUpdate = targetTable.getEnableUniqueKeyMergeOnWrite() - && cols.size() < targetTable.getColumns().size(); + boolean isPartialUpdate = isMow && !hasClusterKey && cols.size() < targetTable.getColumns().size(); logicalQuery = handleCte(logicalQuery); // make UnboundTableSink return UnboundTableSinkCreator.createUnboundTableSink(nameParts, cols, ImmutableList.of(), diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java b/fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java index 996f9d2fc1dcd4..10db1f88140791 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java @@ -242,6 +242,7 @@ public String getExplainString(String prefix, TExplainLevel explainLevel) { } strBuilder.append(prefix + " TUPLE ID: " + tupleDescriptor.getId() + "\n"); strBuilder.append(prefix + " " + DataPartition.RANDOM.getExplainString(explainLevel)); + strBuilder.append(prefix + " IS_PARTIAL_UPDATE: " + isPartialUpdate); return strBuilder.toString(); } diff --git a/regression-test/data/compaction/test_full_compaction.out b/regression-test/data/compaction/test_full_compaction.out index 7098be6d89d2e6..b25fdad93145cc 100644 --- a/regression-test/data/compaction/test_full_compaction.out +++ b/regression-test/data/compaction/test_full_compaction.out @@ -32,12 +32,12 @@ 2 2 2 20 2 200 -3 100 +3 0 3 100 3 300 -- !select_final -- 1 100 2 200 -3 100 +3 0 diff --git a/regression-test/data/compaction/test_full_compaction_by_table_id.out b/regression-test/data/compaction/test_full_compaction_by_table_id.out index 7098be6d89d2e6..b25fdad93145cc 100644 --- a/regression-test/data/compaction/test_full_compaction_by_table_id.out +++ b/regression-test/data/compaction/test_full_compaction_by_table_id.out @@ -32,12 +32,12 @@ 2 2 2 20 2 200 -3 100 +3 0 3 100 3 300 -- !select_final -- 1 100 2 200 -3 100 +3 0 diff --git a/regression-test/data/delete_p0/test_delete_on_value.out b/regression-test/data/delete_p0/test_delete_predicate_on_value.out similarity index 60% rename from regression-test/data/delete_p0/test_delete_on_value.out rename to regression-test/data/delete_p0/test_delete_predicate_on_value.out index 4a6e652aef3887..e54cb9a6b4a440 100644 --- a/regression-test/data/delete_p0/test_delete_on_value.out +++ b/regression-test/data/delete_p0/test_delete_predicate_on_value.out @@ -1,5 +1,5 @@ -- This file is automatically generated. You should know what you did if you want to edit this --- !sql -- +-- !sql_1 -- 1 1 1 2 2 2 3 3 3 @@ -10,7 +10,7 @@ 8 8 8 9 9 9 --- !sql -- +-- !sql_1 -- 1 1 1 2 2 2 3 3 3 @@ -20,19 +20,24 @@ 8 8 8 9 9 9 --- !sql -- +-- !sql_1 -- 1 1 1 2 2 2 8 8 8 9 9 9 --- !sql -- +-- !skip_delete_predicate_sql_1 -- 1 1 1 0 2 2 2 0 +3 3 3 0 +4 4 4 0 +5 5 5 0 +6 6 6 0 +7 7 7 0 8 8 8 0 9 9 9 0 --- !sql -- +-- !sql_1 -- 1 1 1 2 2 2 4 4 4 @@ -40,57 +45,44 @@ 8 8 8 9 9 9 --- !sql -- +-- !sql_1 -- 1 1 1 2 2 2 4 4 4 8 8 8 9 9 9 --- !sql -- +-- !skip_delete_predicate_sql_1 -- 1 1 1 0 2 2 2 0 3 3 3 0 -3 3 3 1 4 4 4 0 -4 4 4 0 -4 4 4 1 -5 5 5 0 5 5 5 0 -5 5 5 1 -5 5 5 1 6 6 6 0 -6 6 6 1 7 7 7 0 -7 7 7 1 8 8 8 0 9 9 9 0 --- !sql -- +-- !sql_3 -- 1 1 10 --- !sql -- +-- !skip_delete_predicate_sql_3 -- 1 1 5 0 3 5 1 1 10 0 2 10 --- !sql -- +-- !sql_3 -- --- !sql -- +-- !skip_delete_predicate_sql_3 -- 1 1 5 0 3 5 1 1 10 0 2 10 -1 1 10 1 4 10 --- !sql -- +-- !sql_4 -- 1 1 10 --- !sql -- -1 1 5 0 3 5 -1 1 10 0 2 10 - --- !sql -- +-- !sql_4 -- --- !sql -- +-- !skip_delete_predicate_sql_4 -- +1 \N \N 1 4 10 1 1 5 0 3 5 1 1 10 0 2 10 -1 1 10 1 4 10 diff --git a/regression-test/data/nereids_p0/delete/delete_mow_partial_update.out b/regression-test/data/nereids_p0/delete/delete_mow_partial_update.out index b4237a038036db..54b9aa4cee9bae 100644 --- a/regression-test/data/nereids_p0/delete/delete_mow_partial_update.out +++ b/regression-test/data/nereids_p0/delete/delete_mow_partial_update.out @@ -7,20 +7,26 @@ 5 5 -- !sql -- +2 2 4 4 5 5 -- !sql_skip_delete_predicate -- +2 2 4 4 5 5 -- !sql -- +2 2 +5 5 + +-- !sql -- +1 \N 1 1 1 0 -1 1 1 2 2 0 -2 2 1 +3 \N 1 3 3 0 -3 3 1 +4 \N 1 4 4 0 5 5 0 @@ -53,20 +59,26 @@ 5 5 -- !sql -- +2 2 4 4 5 5 -- !sql_skip_delete_predicate -- +2 2 4 4 5 5 -- !sql -- +2 2 +5 5 + +-- !sql -- +1 \N 1 1 1 0 -1 1 1 2 2 0 -2 2 1 +3 \N 1 3 3 0 -3 3 1 +4 \N 1 4 4 0 5 5 0 diff --git a/regression-test/data/unique_with_mow_p0/partial_update/test_new_partial_update_delete.out b/regression-test/data/unique_with_mow_p0/partial_update/test_new_partial_update_delete.out index 318f28c8000ccb..36507eff4fdc01 100644 --- a/regression-test/data/unique_with_mow_p0/partial_update/test_new_partial_update_delete.out +++ b/regression-test/data/unique_with_mow_p0/partial_update/test_new_partial_update_delete.out @@ -5,7 +5,7 @@ -- !sql2 -- -- !sql3 -- -1 1 1 1 1 1 +1 \N \N \N \N 1 -- !sql4 -- 1 2 \N \N \N @@ -57,7 +57,7 @@ -- !sql2 -- -- !sql3 -- -1 1 1 1 1 1 +1 \N \N \N \N 1 -- !sql4 -- 1 2 \N \N \N diff --git a/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_delete.out b/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_delete.out index c16e954d73309c..e1623d42460181 100644 --- a/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_delete.out +++ b/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_delete.out @@ -6,17 +6,22 @@ 4 4 4 4 4 5 5 5 5 5 +-- !sql -- +2 2 2 2 2 +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 0 \N 1 1 1 1 1 1 0 -1 1 1 1 1 1 +2 \N \N 0 \N 1 2 2 2 2 2 0 -2 2 2 2 2 1 +3 \N \N 0 \N 1 3 3 3 3 3 0 -3 3 3 3 3 1 4 4 4 4 4 0 5 5 5 5 5 0 @@ -48,17 +53,22 @@ 4 4 4 4 4 5 5 5 5 5 +-- !sql -- +2 2 2 2 2 +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 0 \N 1 1 1 1 1 1 0 -1 1 1 1 1 1 +2 \N \N 0 \N 1 2 2 2 2 2 0 -2 2 2 2 2 1 +3 \N \N 0 \N 1 3 3 3 3 3 0 -3 3 3 3 3 1 4 4 4 4 4 0 5 5 5 5 5 0 diff --git a/regression-test/suites/compaction/test_compaction_uniq_cluster_keys_with_delete.groovy b/regression-test/suites/compaction/test_compaction_uniq_cluster_keys_with_delete.groovy index 932835ec3c8644..0a6199bb406ba8 100644 --- a/regression-test/suites/compaction/test_compaction_uniq_cluster_keys_with_delete.groovy +++ b/regression-test/suites/compaction/test_compaction_uniq_cluster_keys_with_delete.groovy @@ -66,7 +66,8 @@ suite("test_compaction_uniq_cluster_keys_with_delete") { DISTRIBUTED BY HASH(`user_id`) PROPERTIES ( "replication_num" = "1", - "enable_unique_key_merge_on_write" = "true" + "enable_unique_key_merge_on_write" = "true", + "enable_mow_light_delete" = "true" ); """ diff --git a/regression-test/suites/delete_p0/test_delete_on_value.groovy b/regression-test/suites/delete_p0/test_delete_predicate_on_value.groovy similarity index 76% rename from regression-test/suites/delete_p0/test_delete_on_value.groovy rename to regression-test/suites/delete_p0/test_delete_predicate_on_value.groovy index d980fb09ca1065..fc013930bea1bc 100644 --- a/regression-test/suites/delete_p0/test_delete_on_value.groovy +++ b/regression-test/suites/delete_p0/test_delete_predicate_on_value.groovy @@ -15,11 +15,8 @@ // specific language governing permissions and limitations // under the License. -suite("test_delete_on_value") { +suite("test_delete_predicate_on_value") { - sql "set skip_storage_engine_merge=false;" - sql "set skip_delete_bitmap=false;" - sql "set skip_delete_predicate=false;" def tableName = "test_delete_on_value" sql """ DROP TABLE IF EXISTS ${tableName} """ sql """ CREATE TABLE ${tableName} ( @@ -33,25 +30,27 @@ suite("test_delete_on_value") { PROPERTIES ( "replication_num" = "1", "disable_auto_compaction" = "true", - "enable_unique_key_merge_on_write" = "true" + "enable_unique_key_merge_on_write" = "true", + "enable_mow_light_delete" = "true" );""" sql """ insert into ${tableName} values(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),(6,6,6),(7,7,7),(8,8,8),(9,9,9); """ - qt_sql "select * from ${tableName} order by x,y,z;" + qt_sql_1 "select * from ${tableName} order by x,y,z;" sql "delete from ${tableName} where y=4;" - qt_sql "select * from ${tableName} order by x,y,z;" + qt_sql_1 "select * from ${tableName} order by x,y,z;" sql "delete from ${tableName} where z>=3 and z<=7;" - qt_sql "select * from ${tableName} order by x,y,z;" + qt_sql_1 "select * from ${tableName} order by x,y,z;" sql "set skip_delete_predicate=true;" - qt_sql "select x,y,z,__DORIS_DELETE_SIGN__ from ${tableName} order by x,y,z,__DORIS_DELETE_SIGN__;" + qt_skip_delete_predicate_sql_1 "select x,y,z,__DORIS_DELETE_SIGN__ from ${tableName} order by x,y,z,__DORIS_DELETE_SIGN__;" sql "set skip_delete_predicate=false;" sql "insert into ${tableName} values(4,4,4),(5,5,5);" - qt_sql "select * from ${tableName} order by x,y,z;" + qt_sql_1 "select * from ${tableName} order by x,y,z;" sql "delete from ${tableName} where y=5;" - qt_sql "select * from ${tableName} order by x,y,z;" - sql "set skip_storage_engine_merge=true;" - sql "set skip_delete_bitmap=true;" + qt_sql_1 "select * from ${tableName} order by x,y,z;" + sql "set skip_delete_predicate=true;" - qt_sql "select x,y,z,__DORIS_DELETE_SIGN__ from ${tableName} order by x,y,z,__DORIS_DELETE_SIGN__;" + qt_skip_delete_predicate_sql_1 "select x,y,z,__DORIS_DELETE_SIGN__ from ${tableName} order by x,y,z,__DORIS_DELETE_SIGN__;" + sql "set skip_storage_engine_merge=false;" + sql "DROP TABLE IF EXISTS ${tableName};" @@ -75,9 +74,6 @@ suite("test_delete_on_value") { exception "delete predicate on value column only supports Unique table with merge-on-write enabled and Duplicate table, but Table[test_delete_on_value2] is an Aggregate table." } - sql "set skip_storage_engine_merge=false;" - sql "set skip_delete_bitmap=false;" - sql "set skip_delete_predicate=false;" def tableName3 = "test_delete_on_value_with_seq_col" sql """ DROP TABLE IF EXISTS ${tableName3} """ sql """ CREATE TABLE ${tableName3} ( @@ -92,29 +88,34 @@ suite("test_delete_on_value") { "disable_auto_compaction" = "true", "replication_num" = "1", "enable_unique_key_merge_on_write" = "true", + "enable_mow_light_delete" = "true", "function_column.sequence_col" = "z" );""" sql "insert into ${tableName3} values(1,1,10);" sql "insert into ${tableName3} values(1,1,5);" - qt_sql "select * from ${tableName3} order by x,y,z;" + qt_sql_3 "select * from ${tableName3} order by x,y,z;" + sql "set skip_storage_engine_merge=true;" sql "set skip_delete_bitmap=true;" sql "set skip_delete_predicate=true;" - qt_sql "select * from ${tableName3} order by x,y,z;" + qt_skip_delete_predicate_sql_3 "select * from ${tableName3} order by x,y,z;" sql "set skip_storage_engine_merge=false;" sql "set skip_delete_bitmap=false;" sql "set skip_delete_predicate=false;" + sql "delete from ${tableName3} where z>=10;" - qt_sql "select * from ${tableName3} order by x,y,z;" + qt_sql_3 "select * from ${tableName3} order by x,y,z;" + sql "set skip_storage_engine_merge=true;" sql "set skip_delete_bitmap=true;" sql "set skip_delete_predicate=true;" - qt_sql "select * from ${tableName3} order by x,y,z;" - sql "DROP TABLE IF EXISTS ${tableName3}" - + qt_skip_delete_predicate_sql_3 "select * from ${tableName3} order by x,y,z;" sql "set skip_storage_engine_merge=false;" sql "set skip_delete_bitmap=false;" sql "set skip_delete_predicate=false;" + sql "DROP TABLE IF EXISTS ${tableName3}" + + def tableName4 = "test_delete_on_value_with_seq_col_mor" sql """ DROP TABLE IF EXISTS ${tableName4} """ sql """ CREATE TABLE ${tableName4} ( @@ -134,23 +135,17 @@ suite("test_delete_on_value") { // test mor table sql "insert into ${tableName4} values(1,1,10);" sql "insert into ${tableName4} values(1,1,5);" - qt_sql "select * from ${tableName4} order by x,y,z;" - sql "set skip_storage_engine_merge=true;" - sql "set skip_delete_bitmap=true;" - sql "set skip_delete_predicate=true;" - qt_sql "select * from ${tableName4} order by x,y,z;" - sql "set skip_storage_engine_merge=false;" - sql "set skip_delete_bitmap=false;" - sql "set skip_delete_predicate=false;" + qt_sql_4 "select * from ${tableName4} order by x,y,z;" sql "delete from ${tableName4} where z>=10;" - qt_sql "select * from ${tableName4} order by x,y,z;" + qt_sql_4 "select * from ${tableName4} order by x,y,z;" + sql "set skip_storage_engine_merge=true;" sql "set skip_delete_bitmap=true;" sql "set skip_delete_predicate=true;" - qt_sql "select * from ${tableName4} order by x,y,z;" - sql "DROP TABLE IF EXISTS ${tableName4};" - + qt_skip_delete_predicate_sql_4 "select * from ${tableName4} order by x,y,z;" sql "set skip_storage_engine_merge=false;" sql "set skip_delete_bitmap=false;" sql "set skip_delete_predicate=false;" + + sql "DROP TABLE IF EXISTS ${tableName4};" } diff --git a/regression-test/suites/nereids_p0/delete/delete_mow_partial_update.groovy b/regression-test/suites/nereids_p0/delete/delete_mow_partial_update.groovy index bfb27ce14ba7b3..87a93ae73a6e21 100644 --- a/regression-test/suites/nereids_p0/delete/delete_mow_partial_update.groovy +++ b/regression-test/suites/nereids_p0/delete/delete_mow_partial_update.groovy @@ -60,7 +60,12 @@ suite('nereids_delete_mow_partial_update') { sql "insert into ${tableName1} values(1, 1), (2, 2), (3, 3), (4, 4), (5, 5);" qt_sql "select * from ${tableName1} order by uid;" - sql "insert into ${tableName2} values(1), (2), (3);" + sql "insert into ${tableName2} values(1), (3);" + explain { + // delete from using command should use partial update + sql "delete from ${tableName1} A using ${tableName2} B where A.uid=B.uid;" + contains "IS_PARTIAL_UPDATE: true" + } sql "delete from ${tableName1} A using ${tableName2} B where A.uid=B.uid;" qt_sql "select * from ${tableName1} order by uid;" // when using parital update insert stmt for delete stmt, it will use delete bitmap or delete sign rather than @@ -68,6 +73,23 @@ suite('nereids_delete_mow_partial_update') { sql "set skip_delete_predicate=true;" sql "sync" qt_sql_skip_delete_predicate "select * from ${tableName1} order by uid;" + sql "set skip_delete_predicate=false;" + sql "sync" + + explain { + // delete from command should use partial update + sql "delete from ${tableName1} where ${tableName1}.uid=2;" + contains "IS_PARTIAL_UPDATE: true" + } + + explain { + // delete from command should use partial update + sql "delete from ${tableName1} where ${tableName1}.v1=4;" + contains "IS_PARTIAL_UPDATE: true" + } + + sql "delete from ${tableName1} where ${tableName1}.v1=4;" + qt_sql "select * from ${tableName1} order by uid;" sql "set skip_delete_sign=true;" sql "set skip_storage_engine_merge=true;" diff --git a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/customer_create.sql b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/customer_create.sql index 789c8fd79b8972..53c1b103328493 100644 --- a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/customer_create.sql +++ b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/customer_create.sql @@ -15,5 +15,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/date_create.sql b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/date_create.sql index cf6b4b6a73739f..b96d1038c74b40 100644 --- a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/date_create.sql +++ b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/date_create.sql @@ -24,5 +24,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/lineorder_create.sql b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/lineorder_create.sql index 2dff3181c9d686..37ba740fa0697a 100644 --- a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/lineorder_create.sql +++ b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/lineorder_create.sql @@ -32,5 +32,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/part_create.sql b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/part_create.sql index b1b01bcaeca32d..f8b9438a192a2d 100644 --- a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/part_create.sql +++ b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/part_create.sql @@ -16,5 +16,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/supplier_create.sql b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/supplier_create.sql index 53b607a53ffb01..a40662617f6a58 100644 --- a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/supplier_create.sql +++ b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/supplier_create.sql @@ -14,5 +14,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/supplier_sequence_create.sql b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/supplier_sequence_create.sql index 9fef263bf07312..ef1136bbfda22b 100644 --- a/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/supplier_sequence_create.sql +++ b/regression-test/suites/unique_with_mow_c_p0/ssb_unique_load_zstd/ddl/supplier_sequence_create.sql @@ -15,5 +15,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p0/test_pk_uk_case.groovy b/regression-test/suites/unique_with_mow_c_p0/test_pk_uk_case.groovy index c0cb1add123c99..f4bc7b2f205ba9 100644 --- a/regression-test/suites/unique_with_mow_c_p0/test_pk_uk_case.groovy +++ b/regression-test/suites/unique_with_mow_c_p0/test_pk_uk_case.groovy @@ -61,7 +61,8 @@ suite("test_pk_uk_case_cluster_key") { PROPERTIES ( "replication_num" = "1", "disable_auto_compaction" = "true", - "enable_unique_key_merge_on_write" = "true" + "enable_unique_key_merge_on_write" = "true", + "enable_mow_light_delete" = "true" ) """ diff --git a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/customer_create.sql b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/customer_create.sql index 0bf16f3911ad52..30df14525cf71c 100644 --- a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/customer_create.sql +++ b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/customer_create.sql @@ -15,5 +15,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/date_create.sql b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/date_create.sql index 32b4e24f6cbbb3..ffd796f227a287 100644 --- a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/date_create.sql +++ b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/date_create.sql @@ -24,5 +24,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/lineorder_create.sql b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/lineorder_create.sql index 8cb2ae73098772..0945fe0af46982 100644 --- a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/lineorder_create.sql +++ b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/lineorder_create.sql @@ -32,5 +32,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/part_create.sql b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/part_create.sql index 722b7eba1a826f..86e906b4c2b2e6 100644 --- a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/part_create.sql +++ b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/part_create.sql @@ -16,5 +16,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/supplier_create.sql b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/supplier_create.sql index aa798357e819d3..404e4987b444b8 100644 --- a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/supplier_create.sql +++ b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/supplier_create.sql @@ -14,5 +14,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/supplier_sequence_create.sql b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/supplier_sequence_create.sql index fd109360fda7a2..74fa9c46baa222 100644 --- a/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/supplier_sequence_create.sql +++ b/regression-test/suites/unique_with_mow_c_p2/ssb_unique_load_zstd/ddl/supplier_sequence_create.sql @@ -15,5 +15,6 @@ PROPERTIES ( "compression"="zstd", "replication_num" = "1", "disable_auto_compaction" = "true", -"enable_unique_key_merge_on_write" = "true" +"enable_unique_key_merge_on_write" = "true", +"enable_mow_light_delete" = "true" ); diff --git a/regression-test/suites/unique_with_mow_c_p2/test_pk_uk_case.groovy b/regression-test/suites/unique_with_mow_c_p2/test_pk_uk_case.groovy index 2ff883ecb5087b..c962dc9109ef8b 100644 --- a/regression-test/suites/unique_with_mow_c_p2/test_pk_uk_case.groovy +++ b/regression-test/suites/unique_with_mow_c_p2/test_pk_uk_case.groovy @@ -60,7 +60,8 @@ suite("test_pk_uk_case") { DISTRIBUTED BY HASH(L_ORDERKEY) BUCKETS 1 PROPERTIES ( "replication_num" = "1", - "enable_unique_key_merge_on_write" = "true" + "enable_unique_key_merge_on_write" = "true", + "enable_mow_light_delete" = "true" ) """ diff --git a/regression-test/suites/unique_with_mow_p0/partial_update/test_new_partial_update_delete.groovy b/regression-test/suites/unique_with_mow_p0/partial_update/test_new_partial_update_delete.groovy index bcd8d5f2842f97..f82510914b5865 100644 --- a/regression-test/suites/unique_with_mow_p0/partial_update/test_new_partial_update_delete.groovy +++ b/regression-test/suites/unique_with_mow_p0/partial_update/test_new_partial_update_delete.groovy @@ -97,7 +97,7 @@ suite('test_new_partial_update_delete') { // empty qt_sql2 "select * from ${tableName1} order by k1;" sql "set show_hidden_columns = true;" - // 1,1,1,1,1,1 + // 1,null,null,null,null,1 qt_sql3 "select k1,c1,c2,c3,c4,__DORIS_DELETE_SIGN__ from ${tableName1} order by k1;" sql "set show_hidden_columns = false;" sql "set enable_unique_key_partial_update=true;" @@ -210,7 +210,7 @@ suite('test_new_partial_update_delete') { // empty qt_sql22 "select * from ${tableName2} order by k1;" sql "set show_hidden_columns = true;" - // 1,1,1,1,1,1 + // 1,null,null,null,1 qt_sql23 "select k1,c1,c2,c3,c4,__DORIS_DELETE_SIGN__ from ${tableName2} order by k1;" sql "set show_hidden_columns = false;" sql "set enable_unique_key_partial_update=true;" diff --git a/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_delete.groovy b/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_delete.groovy index 38720646b2b533..0d83d94f91c918 100644 --- a/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_delete.groovy +++ b/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_delete.groovy @@ -56,9 +56,13 @@ suite('test_partial_update_delete') { 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 "insert into ${tableName2} values(1),(3);" sql "delete from ${tableName1} A using ${tableName2} B where A.k1=B.k;" qt_sql "select * from ${tableName1} order by k1;" + + sql "delete from ${tableName1} where c2=2;" + 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;"