Skip to content

Commit

Permalink
[regression test](stream load) add case for strict_mode=true and max_…
Browse files Browse the repository at this point in the history
…filter_ratio=0.5 (apache#27125)
  • Loading branch information
liugddx authored Nov 17, 2023
1 parent ee08958 commit c7d961c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions regression-test/data/load_p0/stream_load/test_stream_load.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
-2 -51 \N 1 \N \N \N \N \N \N \N 2 \N \N
-2 -50 \N 1 \N \N \N \N \N \N \N \N j \N

-- !sql_strict_mode_ratio --
-2 -51 \N 1 \N \N \N \N \N \N \N 2 \N \N

-- !sql1 --
2019 9 9 9 7.700 a 2019-09-09 1970-01-01T08:33:39 k7 9.0 9.0

Expand Down
28 changes: 28 additions & 0 deletions regression-test/suites/load_p0/stream_load/test_stream_load.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,34 @@ suite("test_stream_load", "p0") {
}
}

sql "truncate table ${tableName}"
sql "sync"

streamLoad {
table "${tableName}"

set 'column_separator', '\t'
set 'columns', 'k1, k2, v2, v10, v11'
set 'partitions', 'partition_a, partition_b, partition_c, partition_d'
set 'strict_mode', 'true'
set 'max_filter_ratio', '0.5'

file 'test_strict_mode_fail.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(1, json.NumberFilteredRows)
}
}
qt_sql_strict_mode_ratio "select * from ${tableName} order by k1, k2"

sql "sync"
sql """ DROP TABLE IF EXISTS ${tableName} """
sql """
Expand Down

0 comments on commit c7d961c

Please sign in to comment.