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

dataroaring pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new f5f4a738627 [branch-2.0](cherry-pick)  add chunked transfer json test 
(#26902) (#27164)
f5f4a738627 is described below

commit f5f4a7386276f172f8b040542d9ade39f2d7a5f0
Author: HHoflittlefish777 <[email protected]>
AuthorDate: Fri Nov 17 14:46:38 2023 +0800

    [branch-2.0](cherry-pick)  add chunked transfer json test (#26902) (#27164)
---
 .../load_p0/stream_load/test_chunked_transfer.json |  2 ++
 .../data/load_p0/stream_load/test_stream_load.out  | 14 +++++++++-
 .../load_p0/stream_load/test_stream_load.groovy    | 30 +++++++++++++++++++++-
 3 files changed, 44 insertions(+), 2 deletions(-)

diff --git 
a/regression-test/data/load_p0/stream_load/test_chunked_transfer.json 
b/regression-test/data/load_p0/stream_load/test_chunked_transfer.json
new file mode 100644
index 00000000000..25c04715335
--- /dev/null
+++ b/regression-test/data/load_p0/stream_load/test_chunked_transfer.json
@@ -0,0 +1,2 @@
+{ "k1": "1", "k2": "50", "v1": "1", "v2": "1", "v3": "3", "k4": "1"}
+{ "k1": "-1", "k2": "50", "v1": "1", "v2": "1", "v3": "3", "k4": "1"}
\ No newline at end of file
diff --git a/regression-test/data/load_p0/stream_load/test_stream_load.out 
b/regression-test/data/load_p0/stream_load/test_stream_load.out
index cbfc1d7f6f5..86b8a88aa2c 100644
--- a/regression-test/data/load_p0/stream_load/test_stream_load.out
+++ b/regression-test/data/load_p0/stream_load/test_stream_load.out
@@ -105,6 +105,18 @@
 33     9       8       2       1
 38     1       9       2       5
 
--- !sql_chunked_transfer --
+-- !sql_2pc --
+
+-- !sql_2pc_abort --
+
+-- !sql_2pc_commit --
+1      -50     1       2       1       \N
+2      -50     1       44      1       \N
+
+-- !sql_chunked_transfer_csv --
 1      -50     1       2       1       \N
 2      -50     1       44      1       \N
+
+-- !sql_chunked_transfer_json --
+-1     50      1       1       3       \N
+1      50      1       1       3       \N
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 1b6376bdb6c..de9a9105aad 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
@@ -1011,7 +1011,35 @@ suite("test_stream_load", "p0") {
         json2pc = parseJson(out)
         log.info("test chunked transfer result: ${out}".toString())
 
-        qt_sql_chunked_transfer "select * from ${tableName16} order by k1"
+        qt_sql_chunked_transfer_csv "select * from ${tableName16} order by k1"
+    } finally {
+        sql """ DROP TABLE IF EXISTS ${tableName16} FORCE"""
+    }
+
+    try {
+        sql """ DROP TABLE IF EXISTS ${tableName16} """
+        sql """
+            CREATE TABLE IF NOT EXISTS ${tableName16} (
+                `k1` bigint(20) NULL DEFAULT "1",
+                `k2` bigint(20) NULL ,
+                `v1` tinyint(4) NULL,
+                `v2` tinyint(4) NULL,
+                `v3` tinyint(4) NULL,
+                `v4` DATETIME NULL
+            ) ENGINE=OLAP
+            DISTRIBUTED BY HASH(`k1`) BUCKETS 3
+            PROPERTIES ("replication_allocation" = "tag.location.default: 1");
+        """
+
+        def command = "curl --location-trusted -u 
${context.config.feHttpUser}:${context.config.feHttpPassword} -H 
Transfer-Encoding:chunked -H format:json -H read_json_by_line:true -T 
${context.dataPath}/test_chunked_transfer.json 
http://${context.config.feHttpAddress}/api/${db}/${tableName16}/_stream_load";
+        log.info("test chunked transfer command: ${command}")
+        def process = command.execute()
+        code = process.waitFor()
+        out = process.text
+        json2pc = parseJson(out)
+        log.info("test chunked transfer result: ${out}".toString())
+
+        qt_sql_chunked_transfer_json "select * from ${tableName16} order by k1"
     } finally {
         sql """ DROP TABLE IF EXISTS ${tableName16} FORCE"""
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to