From 80ca2a8dadcc779a4a0356a5093e4376d7c7f2d7 Mon Sep 17 00:00:00 2001 From: bobhan1 Date: Sat, 14 Sep 2024 14:09:30 +0800 Subject: [PATCH] add update case --- .../test_partial_update_seq_map_col.out | 96 +++++++++++++++---- .../test_partial_update_seq_map_col.groovy | 27 +++++- 2 files changed, 104 insertions(+), 19 deletions(-) diff --git a/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_seq_map_col.out b/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_seq_map_col.out index b122549be249860..5bdfef021827ac1 100644 --- a/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_seq_map_col.out +++ b/regression-test/data/unique_with_mow_p0/partial_update/test_partial_update_seq_map_col.out @@ -1,9 +1,25 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !sql1 -- -1 1 -2 2 -3 3 -4 4 +1 1 \N +2 2 \N +3 3 \N +4 4 \N + +-- !sql1 -- +1 1 20 +2 2 20 +3 3 \N +4 4 \N + +-- !sql1 -- +1 1 20 +2 2 20 +3 3 \N +4 4 \N + +-- !sql1 -- +3 3 2099-09-10T12:00:00.977174 \N 2099-09-10T12:00:00.977174 +4 4 2099-09-10T12:00:00.977174 \N 2099-09-10T12:00:00.977174 -- !sql2 -- 1 1 @@ -31,10 +47,26 @@ 4 4 \N \N -- !sql1 -- -1 1 -2 2 -3 3 -4 4 +1 1 \N +2 2 \N +3 3 \N +4 4 \N + +-- !sql1 -- +1 1 20 +2 2 20 +3 3 \N +4 4 \N + +-- !sql1 -- +1 1 20 +2 2 20 +3 3 \N +4 4 \N + +-- !sql1 -- +3 3 2099-09-10T12:00:00.977174 \N 2099-09-10T12:00:00.977174 +4 4 2099-09-10T12:00:00.977174 \N 2099-09-10T12:00:00.977174 -- !sql2 -- 1 1 @@ -62,10 +94,26 @@ 4 4 \N \N -- !sql1 -- -1 1 -2 2 -3 3 -4 4 +1 1 \N +2 2 \N +3 3 \N +4 4 \N + +-- !sql1 -- +1 1 20 +2 2 20 +3 3 \N +4 4 \N + +-- !sql1 -- +1 1 20 +2 2 20 +3 3 \N +4 4 \N + +-- !sql1 -- +3 3 2099-09-10T12:00:00.977174 \N 2099-09-10T12:00:00.977174 +4 4 2099-09-10T12:00:00.977174 \N 2099-09-10T12:00:00.977174 -- !sql2 -- 1 1 @@ -93,10 +141,26 @@ 4 4 \N \N -- !sql1 -- -1 1 -2 2 -3 3 -4 4 +1 1 \N +2 2 \N +3 3 \N +4 4 \N + +-- !sql1 -- +1 1 20 +2 2 20 +3 3 \N +4 4 \N + +-- !sql1 -- +1 1 20 +2 2 20 +3 3 \N +4 4 \N + +-- !sql1 -- +3 3 2099-09-10T12:00:00.977174 \N 2099-09-10T12:00:00.977174 +4 4 2099-09-10T12:00:00.977174 \N 2099-09-10T12:00:00.977174 -- !sql2 -- 1 1 diff --git a/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_map_col.groovy b/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_map_col.groovy index 01d3dee976b945f..ced58f19c99f428 100644 --- a/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_map_col.groovy +++ b/regression-test/suites/unique_with_mow_p0/partial_update/test_partial_update_seq_map_col.groovy @@ -27,7 +27,6 @@ suite("test_partial_update_seq_map_col", "p0") { } sql "set enable_insert_strict=false;" sql "set enable_unique_key_partial_update=true;" - sql "set show_hidden_columns=true;" sql "sync;" def tableName = "test_partial_update_seq_map_col1" @@ -36,6 +35,10 @@ suite("test_partial_update_seq_map_col", "p0") { `k` BIGINT NOT NULL, `c1` int, `c2` datetime(6) null default current_timestamp(6), + c3 int, + c4 int, + c5 int, + c6 int ) UNIQUE KEY(`k`) DISTRIBUTED BY HASH(`k`) BUCKETS 1 PROPERTIES ( @@ -47,8 +50,26 @@ suite("test_partial_update_seq_map_col", "p0") { sql "insert into ${tableName}(k,c1) values(2,2);" sql "insert into ${tableName}(k,c1) values(3,3);" sql "insert into ${tableName}(k,c1) values(4,4);" - order_qt_sql1 "select k,c1 from ${tableName} where c2=__DORIS_SEQUENCE_COL__;" - + order_qt_sql1 "select k,c1,c3 from ${tableName} where c2=__DORIS_SEQUENCE_COL__;" + // update column which is not sequence map col + if (use_nereids) { + explain { + sql "update ${tableName} set c3=20 where c1<=2;" + contains "IS_PARTIAL_UPDATE: false" + } + } + sql "update ${tableName} set c3=20 where c1<=2;" + order_qt_sql1 "select k,c1,c3 from ${tableName} where c2=__DORIS_SEQUENCE_COL__;" + // update sequence map col + if (use_nereids) { + explain { + sql "update ${tableName} set c2='2099-09-10 12:00:00.977174' where k>2;" + contains "IS_PARTIAL_UPDATE: false" + } + } + sql "update ${tableName} set c2='2099-09-10 12:00:00.977174' where k>2;" + order_qt_sql1 "select k,c1,c3 from ${tableName} where c2=__DORIS_SEQUENCE_COL__;" + order_qt_sql1 "select k,c1,c2,c3,__DORIS_SEQUENCE_COL__ from ${tableName} where c1>2;" tableName = "test_partial_update_seq_map_col2" sql """ DROP TABLE IF EXISTS ${tableName} """