Skip to content

Commit

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

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

-- !sql --
1 "ddddddddddd" 1000 123 10 0 5 10
2 "eeeeee" 2000 223 20 0 5 20
3 "aaaaa" 3000 323 30 0 5 30
4 "bbbbbbbb" 4000 423 40 0 5 40
5 "cccccccccccc" 5000 523 50 0 5 50

Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,173 @@ 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_seq_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",
"function_column.sequence_col" = "dft")
"""

sql """insert into ${tableName} values
(2, "deprecated", 99999, 999, 1),
(2, "doris2", 2000, 223, 2),
(1, "doris", 1000, 123, 1),
(3, "deprecated", 99999, 999, 2),
(5, "doris5", 5000, 523, 5),
(4, "doris4", 4000, 423, 4),
(4, "deprecated", 99999, 999, 3),
(4, "deprecated", 99999, 999, 1),
(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 "set show_hidden_columns=true;"
sql "sync"

qt_sql """ select * from ${tableName} order by id;"""
sql "set show_hidden_columns=false;"
sql "sync"
sql """ DROP TABLE IF EXISTS ${tableName}; """


tableName = "test_primary_key_row_store_seq_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",
"function_column.sequence_col" = "dft",
"store_row_column" = "true")
"""

sql """insert into ${tableName} values
(2, "deprecated", 99999, 999, 1),
(2, "doris2", 2000, 223, 2),
(1, "doris", 1000, 123, 1),
(3, "deprecated", 99999, 999, 2),
(5, "doris5", 5000, 523, 5),
(4, "doris4", 4000, 423, 4),
(4, "deprecated", 99999, 999, 3),
(4, "deprecated", 99999, 999, 1),
(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 "set show_hidden_columns=true;"
sql "sync"

qt_sql """ select id,name,score,test,dft,__DORIS_DELETE_SIGN__,__DORIS_VERSION_COL__,__DORIS_SEQUENCE_COL__ from ${tableName} order by id;"""

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

0 comments on commit b8def92

Please sign in to comment.