Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bobhan1 committed Oct 12, 2023
1 parent 80a49ed commit 4c04b73
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@
4 "bbbbbbbb" 4444 499 40
5 "cccccccccccc" 5555 599 50

-- !sql --
1 "ddddddddddd" 1111 199 10
2 "eeeeee" 2222 299 20
3 "aaaaa" 3333 399 30
4 "bbbbbbbb" 4444 499 40
5 "cccccccccccc" 5555 599 50

Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,79 @@ suite("test_primary_key_partial_update_parallel", "p0") {
qt_sql """ select * from ${tableName} order by id;"""

sql """ DROP TABLE IF EXISTS ${tableName}; """


tableName = "test_primary_key_row_store_partial_update"
// create table
sql """ DROP TABLE IF EXISTS ${tableName} """
sql """
CREATE TABLE ${tableName} (
`id` int(11) NOT NULL COMMENT "用户 ID",
`name` varchar(65533) NOT NULL COMMENT "用户姓名",
`score` int(11) NOT NULL COMMENT "用户得分",
`test` int(11) NULL COMMENT "null test",
`dft` int(11) DEFAULT "4321")
UNIQUE KEY(`id`) DISTRIBUTED BY HASH(`id`) BUCKETS 1
PROPERTIES("replication_num" = "1", "enable_unique_key_merge_on_write" = "true")
"""

sql """insert into ${tableName} values
(2, "doris2", 2000, 223, 2),
(1, "doris", 1000, 123, 1),
(5, "doris5", 5000, 523, 5),
(4, "doris4", 4000, 423, 4),
(3, "doris3", 3000, 323, 3);"""

t1 = Thread.startDaemon {
streamLoad {
table "${tableName}"

set 'column_separator', ','
set 'format', 'csv'
set 'partial_columns', 'true'
set 'columns', 'id,name'

file 'partial_update_parallel1.csv'
time 10000 // limit inflight 10s
}
}

t2 = Thread.startDaemon {
streamLoad {
table "${tableName}"

set 'column_separator', ','
set 'format', 'csv'
set 'partial_columns', 'true'
set 'columns', 'id,score,test'

file 'partial_update_parallel2.csv'
time 10000 // limit inflight 10s
}
}

t3 = Thread.startDaemon {
streamLoad {
table "${tableName}"

set 'column_separator', ','
set 'format', 'csv'
set 'partial_columns', 'true'
set 'columns', 'id,dft'

file 'partial_update_parallel3.csv'
time 10000 // limit inflight 10s
}
}

t1.join()
t2.join()
t3.join()

sql "sync"

qt_sql """ select * from ${tableName} order by id;"""

sql """ DROP TABLE IF EXISTS ${tableName}; """
}

0 comments on commit 4c04b73

Please sign in to comment.