Skip to content

Commit

Permalink
fix case tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
bobhan1 committed Aug 2, 2024
1 parent 0bb099e commit 9562e89
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public LogicalPlan completeQueryPlan(ConnectContext ctx, LogicalPlan logicalQuer
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()) {
expr = new UnboundSlot(tableName, column.getName());
} else if (!isMow && (!column.isVisible() || (!column.isAllowNull() && !column.hasDefaultValue()))) {
Expand Down
4 changes: 2 additions & 2 deletions regression-test/data/compaction/test_full_compaction.out
Original file line number Diff line number Diff line change
Expand Up @@ -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

Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,7 +10,7 @@
8 8 8
9 9 9

-- !sql --
-- !sql_1 --
1 1 1
2 2 2
3 3 3
Expand All @@ -20,77 +20,69 @@
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
5 5 5
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

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-- !sql2 --

-- !sql3 --
1 1 1 1 1 1
1 \N \N \N \N 1

-- !sql4 --
1 2 \N \N \N
Expand Down Expand Up @@ -57,7 +57,7 @@
-- !sql2 --

-- !sql3 --
1 1 1 1 1 1
1 \N \N \N \N 1

-- !sql4 --
1 2 \N \N \N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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} (
Expand All @@ -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};"


Expand All @@ -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} (
Expand All @@ -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} (
Expand All @@ -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};"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;"
Expand Down Expand Up @@ -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;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;"
Expand Down

0 comments on commit 9562e89

Please sign in to comment.