forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](partial update) keep case insensitivity and use the columns' or…
…igin names in partialUpdateCols in origin planner (apache#27223) close: apache#27161
- Loading branch information
Showing
3 changed files
with
154 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
77 changes: 77 additions & 0 deletions
77
...on-test/data/unique_with_mow_p0/partial_update/test_partial_update_case_insensitivity.out
This file contains 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,77 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !sql -- | ||
t1 1 \N \N | ||
|
||
-- !sql -- | ||
t1 1 2 \N | ||
|
||
-- !sql -- | ||
t1 1 2 \N | ||
t2 \N 20 30 | ||
|
||
-- !sql -- | ||
t1 999 2 888 | ||
t2 \N 20 30 | ||
|
||
-- !sql -- | ||
t1 999 2 888 | ||
t2 \N 20 30 | ||
t3 123 456 789 | ||
|
||
-- !sql -- | ||
t1 1 \N \N | ||
|
||
-- !sql -- | ||
t1 1 2 \N | ||
|
||
-- !sql -- | ||
t1 1 2 \N | ||
t2 \N 20 30 | ||
|
||
-- !sql -- | ||
t1 999 2 888 | ||
t2 \N 20 30 | ||
|
||
-- !sql -- | ||
t1 999 2 888 | ||
t2 \N 20 30 | ||
t3 123 456 789 | ||
|
||
-- !sql -- | ||
t1 1 \N \N | ||
|
||
-- !sql -- | ||
t1 1 2 \N | ||
|
||
-- !sql -- | ||
t1 1 2 \N | ||
t2 \N 20 30 | ||
|
||
-- !sql -- | ||
t1 999 2 888 | ||
t2 \N 20 30 | ||
|
||
-- !sql -- | ||
t1 999 2 888 | ||
t2 \N 20 30 | ||
t3 123 456 789 | ||
|
||
-- !sql -- | ||
t1 1 \N \N | ||
|
||
-- !sql -- | ||
t1 1 2 \N | ||
|
||
-- !sql -- | ||
t1 1 2 \N | ||
t2 \N 20 30 | ||
|
||
-- !sql -- | ||
t1 999 2 888 | ||
t2 \N 20 30 | ||
|
||
-- !sql -- | ||
t1 999 2 888 | ||
t2 \N 20 30 | ||
t3 123 456 789 | ||
|
71 changes: 71 additions & 0 deletions
71
...st/suites/unique_with_mow_p0/partial_update/test_partial_update_case_insensitivity.groovy
This file contains 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,71 @@ | ||
|
||
// 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_case_insensitivity", "p0") { | ||
String db = context.config.getDbNameByFile(context.file) | ||
sql "select 1;" // to create database | ||
|
||
for (def use_row_store : [false, true]) { | ||
for (def use_nereids_planner : [false, true]) { | ||
logger.info("current params: use_row_store: ${use_row_store}, use_nereids_planner: ${use_nereids_planner}") | ||
connect(user = context.config.jdbcUser, password = context.config.jdbcPassword, url = context.config.jdbcUrl) { | ||
sql "use ${db};" | ||
if (use_nereids_planner) { | ||
sql """ set enable_nereids_dml = true; """ | ||
sql """ set enable_nereids_planner=true; """ | ||
sql """ set enable_fallback_to_original_planner=false; """ | ||
} else { | ||
sql """ set enable_nereids_dml = false; """ | ||
sql """ set enable_nereids_planner = false; """ | ||
} | ||
|
||
def tableName = "test_partial_update_case_insensitivity" | ||
sql """ DROP TABLE IF EXISTS ${tableName} """ | ||
sql """ CREATE TABLE ${tableName} ( | ||
name varchar(300), | ||
status int, | ||
MY_COLUMN int, | ||
UpAndDown int | ||
) ENGINE=OLAP | ||
UNIQUE KEY(name) COMMENT 'OLAP' | ||
DISTRIBUTED BY HASH(name) BUCKETS 1 | ||
PROPERTIES ( | ||
"replication_allocation" = "tag.location.default: 1", | ||
"enable_unique_key_merge_on_write" = "true", | ||
"store_row_column" = "${use_row_store}");""" | ||
|
||
sql "set enable_unique_key_partial_update = true;" | ||
sql "set enable_insert_strict = false;" | ||
sql "sync;" | ||
|
||
sql """ insert into ${tableName}(name, STATUS) values("t1", 1); """ | ||
qt_sql "select * from ${tableName} order by name;" | ||
sql """ insert into ${tableName}(name, my_column) values("t1", 2); """ | ||
qt_sql "select * from ${tableName} order by name;" | ||
sql """ insert into ${tableName}(name, My_Column, uPaNddOWN) values("t2", 20, 30); """ | ||
qt_sql "select * from ${tableName} order by name;" | ||
sql """ insert into ${tableName}(NAME, StAtUs, upanddown) values("t1", 999, 888); """ | ||
qt_sql "select * from ${tableName} order by name;" | ||
sql """ insert into ${tableName}(NaMe, StAtUs, mY_CoLUmN, upAndDoWn) values("t3", 123, 456, 789); """ | ||
qt_sql "select * from ${tableName} order by name;" | ||
|
||
sql """ DROP TABLE IF EXISTS ${tableName} """ | ||
} | ||
} | ||
} | ||
} |