@@ -39,4 +39,51 @@ suite("test_ignore_above_in_index", "p0") {
39
39
sql " insert into ${ tableName} values (20, '1234567890');"
40
40
sql " insert into ${ tableName} values (20, '1234567890');"
41
41
qt_sql " select count() from ${ tableName} where c = '1234567890';"
42
+
43
+ def tableName2 = " test_ignore_above_in_index2"
44
+ sql " DROP TABLE IF EXISTS ${ tableName2} "
45
+ sql """
46
+ CREATE TABLE ${ tableName2} (
47
+ `@timestamp` int(11) NULL COMMENT "",
48
+ `clientip` string NULL COMMENT "",
49
+ `request` string NULL COMMENT "",
50
+ `status` int NULL COMMENT "",
51
+ `size` int NULL COMMENT "",
52
+ INDEX clientip_idx (`clientip`) USING INVERTED PROPERTIES("ignore_above"="5") COMMENT '',
53
+ INDEX request_idx (`request`) USING INVERTED PROPERTIES("parser" = "unicode", "support_phrase" = "true") COMMENT '',
54
+ INDEX status_idx (`status`) USING INVERTED COMMENT '',
55
+ INDEX size_idx (`size`) USING INVERTED COMMENT ''
56
+ ) ENGINE=OLAP
57
+ DUPLICATE KEY(`@timestamp`)
58
+ COMMENT "OLAP"
59
+ DISTRIBUTED BY HASH(`@timestamp`) BUCKETS 1
60
+ PROPERTIES (
61
+ "replication_allocation" = "tag.location.default: 1"
62
+ );
63
+ """
64
+
65
+ // load the json data
66
+ streamLoad {
67
+ table " ${ tableName2} "
68
+
69
+ set ' read_json_by_line' , ' true'
70
+ set ' format' , ' json'
71
+ file ' documents-1000.json' // import json file
72
+ time 10000 // limit inflight 10s
73
+
74
+ // if declared a check callback, the default check condition will ignore.
75
+ // So you must check all condition
76
+ check { result , exception , startTime , endTime ->
77
+ if (exception != null ) {
78
+ throw exception
79
+ }
80
+ log. info(" Stream load result: ${ result} " . toString())
81
+ def json = parseJson(result)
82
+ assertEquals (" success" , json.Status . toLowerCase())
83
+ assertEquals (json.NumberTotalRows , json.NumberLoadedRows + json.NumberUnselectedRows )
84
+ assertTrue (json.NumberLoadedRows > 0 && json.LoadBytes > 0 )
85
+ }
86
+ }
87
+
88
+ qt_sql " select count() from ${ tableName2} where clientip > '17.0';"
42
89
}
0 commit comments