Skip to content

Commit

Permalink
[improvement](regression-test) add chunked transfer json test (apache…
Browse files Browse the repository at this point in the history
  • Loading branch information
sollhui authored and 胥剑旭 committed Dec 14, 2023
1 parent af7e273 commit 89fd7b7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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"}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@
1 -50 1 2 1 \N
2 -50 1 44 1 \N

-- !sql_chunked_transfer --
-- !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

Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,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"""
}
Expand Down

0 comments on commit 89fd7b7

Please sign in to comment.