This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 2beed11256 [Bug](streamload) fix inconsistent load result of be and fe 
(#20950)
2beed11256 is described below

commit 2beed1125660a1ff5dc869a083f164e4355a0a2d
Author: HHoflittlefish777 <77738092+hhoflittlefish...@users.noreply.github.com>
AuthorDate: Wed Jun 21 18:12:51 2023 +0800

    [Bug](streamload) fix inconsistent load result of be and fe (#20950)
---
 .../doris/httpv2/controller/BaseController.java    |  2 +-
 .../data/load_p0/stream_load/test_auth.csv         |  2 +
 .../load_p0/stream_load/test_stream_load.groovy    | 53 ++++++++++++++++++++++
 3 files changed, 56 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/BaseController.java
 
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/BaseController.java
index dc31f5c6d0..091ca673ed 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/BaseController.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/controller/BaseController.java
@@ -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;
         }
diff --git a/regression-test/data/load_p0/stream_load/test_auth.csv 
b/regression-test/data/load_p0/stream_load/test_auth.csv
new file mode 100644
index 0000000000..f049b038f2
--- /dev/null
+++ b/regression-test/data/load_p0/stream_load/test_auth.csv
@@ -0,0 +1,2 @@
+-2|-50|1|44|1
+-2|-50|1|2|1
diff --git a/regression-test/suites/load_p0/stream_load/test_stream_load.groovy 
b/regression-test/suites/load_p0/stream_load/test_stream_load.groovy
index e481c1c541..d1e0895afd 100644
--- a/regression-test/suites/load_p0/stream_load/test_stream_load.groovy
+++ b/regression-test/suites/load_p0/stream_load/test_stream_load.groovy
@@ -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'@'%'"""
+
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to