[Bug](streamload) fix inconsistent load result of be and fe (#20950)

This commit is contained in:
HHoflittlefish777
2023-06-21 18:12:51 +08:00
committed by GitHub
parent 84b97860a1
commit 2beed11256
3 changed files with 56 additions and 1 deletions

View File

@ -244,7 +244,7 @@ public class BaseController {
if (Strings.isNullOrEmpty(encodedAuthString)) {
return false;
}
String[] parts = encodedAuthString.split(" ");
String[] parts = encodedAuthString.split("\\s+");
if (parts.length != 2) {
return false;
}

View File

@ -0,0 +1,2 @@
-2|-50|1|44|1
-2|-50|1|2|1
1 -2 -50 1 44 1
2 -2 -50 1 2 1

View File

@ -831,5 +831,58 @@ suite("test_stream_load", "p0") {
sql "sync"
order_qt_sql1 "select * from ${tableName9} order by k1, k2"
// test common user
def tableName13 = "test_common_user"
sql """ DROP TABLE IF EXISTS ${tableName13} """
sql """
CREATE TABLE IF NOT EXISTS ${tableName13} (
`k1` bigint(20) NULL,
`k2` bigint(20) NULL,
`v1` tinyint(4) SUM NULL,
`v2` tinyint(4) REPLACE NULL,
`v3` tinyint(4) REPLACE_IF_NOT_NULL NULL
) ENGINE=OLAP
AGGREGATE KEY(`k1`, `k2`)
COMMENT 'OLAP'
PARTITION BY RANGE(`k1`)
(PARTITION partition_a VALUES [("-9223372036854775808"), ("10")),
PARTITION partition_b VALUES [("10"), ("20")),
PARTITION partition_c VALUES [("20"), ("30")),
PARTITION partition_d VALUES [("30"), ("40")))
DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 3
PROPERTIES ("replication_allocation" = "tag.location.default: 1");
"""
sql """create USER common_user@'%' IDENTIFIED BY '123456'"""
sql """GRANT LOAD_PRIV ON *.* TO 'common_user'@'%';"""
streamLoad {
table "${tableName13}"
set 'column_separator', '|'
set 'columns', 'k1, k2, v1, v2, v3'
set 'strict_mode', 'true'
set 'Authorization', 'Basic Y29tbW9uX3VzZXI6MTIzNDU2'
file 'test_auth.csv'
time 10000 // limit inflight 10s
check { result, exception, startTime, endTime ->
if (exception != null) {
throw exception
}
log.info("Stream load result: ${result}".toString())
def json = parseJson(result)
assertEquals("success", json.Status.toLowerCase())
assertEquals(2, json.NumberTotalRows)
assertEquals(0, json.NumberFilteredRows)
assertEquals(0, json.NumberUnselectedRows)
}
}
sql "sync"
sql """DROP USER 'common_user'@'%'"""
}