This is an automated email from the ASF dual-hosted git repository.
dataroaring 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 4b6330cb934 [regression test](http stream) add case for strict_mode
(#27098)
4b6330cb934 is described below
commit 4b6330cb934c47a7e7b4739dfefa0b7642393c20
Author: Guangdong Liu <[email protected]>
AuthorDate: Sat Nov 18 00:10:02 2023 +0800
[regression test](http stream) add case for strict_mode (#27098)
---
.../data/load_p0/http_stream/test_http_stream.out | 15 +++++
.../test_http_stream_column_strict_mode.csv | 11 ++++
.../test_index_fault_injection.groovy | 12 ++--
.../load_p0/http_stream/test_http_stream.groovy | 68 +++++++++++++++++++++-
4 files changed, 99 insertions(+), 7 deletions(-)
diff --git a/regression-test/data/load_p0/http_stream/test_http_stream.out
b/regression-test/data/load_p0/http_stream/test_http_stream.out
index 6c2865881a4..fd047d50bfc 100644
--- a/regression-test/data/load_p0/http_stream/test_http_stream.out
+++ b/regression-test/data/load_p0/http_stream/test_http_stream.out
@@ -597,3 +597,18 @@
-- !sql15_1 --
+-- !sql16 --
+10000 aa 1 1.220
+10001 bb 0 33.000
+10002 cc \N \N
+10003 dd \N 2.222
+10004 ee 2 1.222
+10005 ff \N 22.000
+10006 gg 2 \N
+10007 hh 2 2.220
+10008 ii 0 \N
+10009 jj 0 \N
+10010 kk \N 111.000
+
+-- !sql16_1 --
+
diff --git
a/regression-test/data/load_p0/http_stream/test_http_stream_column_strict_mode.csv
b/regression-test/data/load_p0/http_stream/test_http_stream_column_strict_mode.csv
new file mode 100644
index 00000000000..672e5a841fa
--- /dev/null
+++
b/regression-test/data/load_p0/http_stream/test_http_stream_column_strict_mode.csv
@@ -0,0 +1,11 @@
+10000--aa--1--1.22
+10001--bb--0--33
+10002--cc--aa--aa
+10003--dd--222--2.222
+10004--ee--2--1.22222
+10005--ff----22
+10006--gg--2--cc
+10007--hh--2--2.22
+10008--ii--0--
+10009--jj--0--ww
+10010--kk--x--111
diff --git
a/regression-test/suites/fault_injection_p0/test_index_fault_injection.groovy
b/regression-test/suites/fault_injection_p0/test_index_fault_injection.groovy
index b3f6c24d60a..08c2bc1b56f 100644
---
a/regression-test/suites/fault_injection_p0/test_index_fault_injection.groovy
+++
b/regression-test/suites/fault_injection_p0/test_index_fault_injection.groovy
@@ -15,11 +15,11 @@
// specific language governing permissions and limitations
// under the License.
-suite("test_index_failure_injection", "p0", "nonConcurrent") {
+suite("test_index_failure_injection", "nonConcurrent") {
// define a sql table
def testTable_dup = "httplogs_dup"
def testTable_unique = "httplogs_unique"
-
+
def create_httplogs_dup_table = {testTablex ->
// multi-line sql
def result = sql """
@@ -92,14 +92,14 @@ suite("test_index_failure_injection", "p0",
"nonConcurrent") {
);
"""
}
-
+
def load_httplogs_data = {table_name, label, read_flag, format_flag,
file_name, ignore_failure=false,
expected_succ_rows = -1, load_to_single_tablet =
'true' ->
-
+
// load the json data
streamLoad {
table "${table_name}"
-
+
// set http request header params
set 'label', label + "_" + UUID.randomUUID().toString()
set 'read_json_by_line', read_flag
@@ -141,7 +141,7 @@ suite("test_index_failure_injection", "p0",
"nonConcurrent") {
} finally {
GetDebugPoint().disableDebugPointForAllBEs("InvertedIndexWriter._throw_clucene_error_in_bkd_writer_close")
}
- qt_sql "select COUNT() from ${testTable_dup} where request match
'images'"
+ qt_sql "select COUNT() from ${testTable_dup} where request match
'images'"
} finally {
//try_sql("DROP TABLE IF EXISTS ${testTable}")
}
diff --git a/regression-test/suites/load_p0/http_stream/test_http_stream.groovy
b/regression-test/suites/load_p0/http_stream/test_http_stream.groovy
index ad795e947a2..b084c622abc 100644
--- a/regression-test/suites/load_p0/http_stream/test_http_stream.groovy
+++ b/regression-test/suites/load_p0/http_stream/test_http_stream.groovy
@@ -598,7 +598,7 @@ suite("test_http_stream", "p0") {
try_sql "DROP TABLE IF EXISTS ${tableName13}"
}
- // 14. test label
+ // 14. test label
def tableName14 = "test_http_stream_label"
def label = UUID.randomUUID().toString().replaceAll("-", "")
@@ -713,5 +713,71 @@ suite("test_http_stream", "p0") {
} finally {
try_sql "DROP TABLE IF EXISTS ${tableName15}"
}
+
+ // 16. test strict_mode
+ def tableName16 = "test_http_stream_strict_mode"
+
+ try {
+ sql """
+ CREATE TABLE IF NOT EXISTS ${tableName16} (
+ id int,
+ name CHAR(10),
+ tyint1 tinyint,
+ decimal1 decimal(6, 3) NULL
+ )
+ DISTRIBUTED BY HASH(id) BUCKETS 1
+ PROPERTIES (
+ "replication_num" = "1"
+ )
+ """
+
+ streamLoad {
+ set 'version', '1'
+ set 'strict_mode', 'true'
+ set 'sql', """
+ insert into ${db}.${tableName16} select c1, c2, c3, c4
from http_stream("format"="csv", "column_separator"="--")
+ """
+ time 10000
+ file 'test_http_stream_column_strict_mode.csv'
+ check { result, exception, startTime, endTime ->
+ if (exception != null) {
+ throw exception
+ }
+ log.info("http_stream result: ${result}".toString())
+ def json = parseJson(result)
+ assertEquals("success", json.Status.toLowerCase())
+ assertEquals(11, json.NumberTotalRows)
+ assertEquals(0, json.NumberFilteredRows)
+ }
+ }
+
+ qt_sql16 "select id, name, tyint1, decimal1 from ${tableName16} order
by id"
+
+ sql """truncate table ${tableName16}"""
+ sql """sync"""
+
+ // TODO Waiting for the http_stream strict_mode problem to be fixed
+ streamLoad {
+ set 'version', '1'
+ set 'strict_mode', 'test'
+ set 'sql', """
+ insert into ${db}.${tableName16} select c1, c2, c3, c4
from http_stream("format"="csv", "column_separator"="--")
+ """
+ time 10000
+ file 'test_http_stream_column_strict_mode.csv'
+ check { result, exception, startTime, endTime ->
+ if (exception != null) {
+ throw exception
+ }
+ log.info("http_stream result: ${result}".toString())
+ def json = parseJson(result)
+ assertEquals("success", json.Status.toLowerCase())
+ }
+ qt_sql16_1 "select id, name, tyint1, decimal1 from ${tableName16}
order by id"
+ }
+ } finally {
+ try_sql "DROP TABLE IF EXISTS ${tableName16}"
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]