|
|
|
|
@ -18,7 +18,7 @@
|
|
|
|
|
|
|
|
|
|
suite("test_no_index_match", "p0") {
|
|
|
|
|
// define a sql table
|
|
|
|
|
def testTable_unique = "httplogs_unique"
|
|
|
|
|
def testTable = "test_no_index_match"
|
|
|
|
|
|
|
|
|
|
def create_httplogs_unique_table = {testTablex ->
|
|
|
|
|
// multi-line sql
|
|
|
|
|
@ -77,35 +77,38 @@ suite("test_no_index_match", "p0") {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
sql "DROP TABLE IF EXISTS ${testTable_unique}"
|
|
|
|
|
create_httplogs_unique_table.call(testTable_unique)
|
|
|
|
|
load_httplogs_data.call(testTable_unique, 'httplogs_unique', 'true', 'json', 'documents-1000.json')
|
|
|
|
|
sql "DROP TABLE IF EXISTS ${testTable}"
|
|
|
|
|
create_httplogs_unique_table.call(testTable)
|
|
|
|
|
load_httplogs_data.call(testTable, 'test_no_index_match', 'true', 'json', 'documents-1000.json')
|
|
|
|
|
|
|
|
|
|
sql """ INSERT INTO ${testTable_unique} VALUES (1, '1', '', 1, 1); """
|
|
|
|
|
sql """ INSERT INTO ${testTable} VALUES (1, '1', '', 1, 1); """
|
|
|
|
|
|
|
|
|
|
sql 'sync'
|
|
|
|
|
sql """ set enable_common_expr_pushdown = true """
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
qt_sql """ select count() from ${testTable_unique} where (request match_any 'hm bg'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable_unique} where (request match_all 'hm bg'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable_unique} where (request match_phrase 'hm bg'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable_unique} where (request match_phrase_prefix 'hm b'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable_unique} where (request match_regexp 'la'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable} where (request match_any 'hm bg'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable} where (request match_all 'hm bg'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable} where (request match_phrase 'hm bg'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable} where (request match_phrase_prefix 'hm b'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable} where (request match_regexp 'la'); """
|
|
|
|
|
|
|
|
|
|
qt_sql """ select count() from ${testTable_unique} where (request match_phrase '欧冶工业品'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable_unique} where (request match_phrase_prefix '欧冶工业品'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable} where (request match_phrase '欧冶工业品'); """
|
|
|
|
|
qt_sql """ select count() from ${testTable} where (request match_phrase_prefix '欧冶工业品'); """
|
|
|
|
|
|
|
|
|
|
qt_sql """ select count() from ${testTable} where (request match_regexp ''); """
|
|
|
|
|
} finally {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
sql """ select /*+ SET_VAR(enable_match_without_inverted_index = 0) */ count() from ${testTable_unique} where (request match_phrase 'hm bg'); """
|
|
|
|
|
sql """ select /*+ SET_VAR(enable_match_without_inverted_index = 0) */ count() from ${testTable} where (request match_phrase 'hm bg'); """
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.info(e.getMessage());
|
|
|
|
|
assertTrue(e.getMessage().contains("match_phrase not support execute_match"))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
sql """ select /*+ SET_VAR(enable_match_without_inverted_index = 0) */ count() from ${testTable_unique} where (request match_phrase_prefix 'hm b'); """
|
|
|
|
|
sql """ select /*+ SET_VAR(enable_match_without_inverted_index = 0) */ count() from ${testTable} where (request match_phrase_prefix 'hm b'); """
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.info(e.getMessage());
|
|
|
|
|
assertTrue(e.getMessage().contains("match_phrase_prefix not support execute_match"))
|
|
|
|
|
|