forked from StarRocks/starrocks
-
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.
[BugFix] fix partial update column name sensitive issue (StarRocks#55430
- Loading branch information
Showing
4 changed files
with
82 additions
and
1 deletion.
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
1 change: 1 addition & 0 deletions
1
test/common/data/stream_load/test_partial_update_case_sensitive.csv
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 @@ | ||
1,"xx" |
51 changes: 51 additions & 0 deletions
51
test/sql/test_stream_load/R/test_partial_update_case_sensitive
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,51 @@ | ||
-- name: test_partial_update_case_sensitive | ||
create database test_partial_update_case_sensitive; | ||
-- result: | ||
-- !result | ||
use test_partial_update_case_sensitive; | ||
-- result: | ||
-- !result | ||
CREATE TABLE test1 ( | ||
`id` bigint(20) NOT NULL COMMENT "", | ||
`name` char(16) NULL DEFAULT "" COMMENT "", | ||
`city` char(16) NULL DEFAULT "" COMMENT "", | ||
`age` char(24) NULL DEFAULT "" COMMENT "" | ||
) ENGINE=OLAP | ||
PRIMARY KEY(`id`) | ||
DISTRIBUTED BY HASH(`id`) | ||
PROPERTIES ( | ||
"replication_num" = "1", | ||
"in_memory" = "false", | ||
"storage_format" = "DEFAULT", | ||
"enable_persistent_index" = "true", | ||
"compression" = "LZ4" | ||
); | ||
-- result: | ||
-- !result | ||
insert into test_partial_update_case_sensitive.test1 values(1,'name1','SD',5),(2,'name2','SH',25),(3,'name3','BJ',50); | ||
-- result: | ||
-- !result | ||
shell: curl --location-trusted -u root: -X PUT -H "Expect:100-continue" -H "format: csv" -H "partial_update: true" -H "columns: ID, city" -H column_separator:, -T ${root_path}/lib/../common/data/stream_load/test_partial_update_case_sensitive.csv ${url}/api/test_partial_update_case_sensitive/test1/_stream_load | ||
-- result: | ||
0 | ||
{ | ||
"Status": "Success", | ||
"Message": "OK" | ||
} | ||
-- !result | ||
sync; | ||
-- result: | ||
-- !result | ||
select * from test_partial_update_case_sensitive.test1; | ||
-- result: | ||
2 name2 SH 25 | ||
1 name1 "xx" 5 | ||
3 name3 BJ 50 | ||
-- !result | ||
select * from test_partial_update_case_sensitive.test1 where name = "name1"; | ||
-- result: | ||
1 name1 "xx" 5 | ||
-- !result | ||
drop database test_partial_update_case_sensitive force; | ||
-- result: | ||
-- !result |
27 changes: 27 additions & 0 deletions
27
test/sql/test_stream_load/T/test_partial_update_case_sensitive
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,27 @@ | ||
-- name: test_partial_update_case_sensitive | ||
create database test_partial_update_case_sensitive; | ||
use test_partial_update_case_sensitive; | ||
CREATE TABLE test1 ( | ||
`id` bigint(20) NOT NULL COMMENT "", | ||
`name` char(16) NULL DEFAULT "" COMMENT "", | ||
`city` char(16) NULL DEFAULT "" COMMENT "", | ||
`age` char(24) NULL DEFAULT "" COMMENT "" | ||
) ENGINE=OLAP | ||
PRIMARY KEY(`id`) | ||
DISTRIBUTED BY HASH(`id`) | ||
PROPERTIES ( | ||
"replication_num" = "1", | ||
"in_memory" = "false", | ||
"storage_format" = "DEFAULT", | ||
"enable_persistent_index" = "true", | ||
"compression" = "LZ4" | ||
); | ||
|
||
insert into test_partial_update_case_sensitive.test1 values(1,'name1','SD',5),(2,'name2','SH',25),(3,'name3','BJ',50); | ||
shell: curl --location-trusted -u root: -X PUT -H "Expect:100-continue" -H "format: csv" -H "partial_update: true" -H "columns: ID, city" -H column_separator:, -T ${root_path}/lib/../common/data/stream_load/test_partial_update_case_sensitive.csv ${url}/api/test_partial_update_case_sensitive/test1/_stream_load | ||
sync; | ||
|
||
select * from test_partial_update_case_sensitive.test1; | ||
select * from test_partial_update_case_sensitive.test1 where name = "name1"; | ||
|
||
drop database test_partial_update_case_sensitive force; |