Skip to content

Commit

Permalink
[test](inverted index) Change the duplicate name test (#39013)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzxl1993 authored Aug 8, 2024
1 parent 0a647ed commit e2c8970
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions regression-test/suites/inverted_index_p0/test_no_index_match.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -77,35 +77,35 @@ 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'

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 '欧冶工业品'); """
} 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"))
Expand Down

0 comments on commit e2c8970

Please sign in to comment.