|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | +suite("test_index_rqg_bug6", "test_index_rqg_bug"){ |
| 18 | + def table = "test_index_rqg_bug6" |
| 19 | + |
| 20 | + sql "drop table if exists ${table}" |
| 21 | + |
| 22 | + sql """ |
| 23 | + create table ${table} ( |
| 24 | + pk int, |
| 25 | + col_int_undef_signed_index_inverted int not null , |
| 26 | + col_varchar_1024__undef_signed_not_null varchar(1024) not null, |
| 27 | + INDEX col_int_undef_signed_index_inverted_idx (`col_int_undef_signed_index_inverted`) USING INVERTED, |
| 28 | + INDEX col_varchar_1024__undef_signed_not_null_idx (`col_varchar_1024__undef_signed_not_null`) USING INVERTED |
| 29 | + ) engine=olap |
| 30 | + DUPLICATE KEY(pk) |
| 31 | + distributed by hash(pk) buckets 1 |
| 32 | + properties("replication_num" = "1"); |
| 33 | + """ |
| 34 | + |
| 35 | + sql """ insert into ${table} values (10, 0, 'ok'), (11, 0, 'oo'), (12, 1, 'ok')""" |
| 36 | + |
| 37 | + |
| 38 | + sql """ sync""" |
| 39 | + sql """ set enable_inverted_index_query = true """ |
| 40 | + sql """ set inverted_index_skip_threshold = 0 """ |
| 41 | + qt_sql """ |
| 42 | + SELECT |
| 43 | + count() |
| 44 | + FROM |
| 45 | + test_index_rqg_bug6 |
| 46 | + WHERE |
| 47 | + IF(col_int_undef_signed_index_inverted = 0, 'true', 'false') = 'false' |
| 48 | + AND ( |
| 49 | + col_varchar_1024__undef_signed_not_null LIKE 'ok' |
| 50 | + OR col_int_undef_signed_index_inverted = 0 |
| 51 | + ); |
| 52 | + """ |
| 53 | + |
| 54 | + qt_sql_2 """ |
| 55 | + SELECT |
| 56 | + count() |
| 57 | + FROM |
| 58 | + test_index_rqg_bug6 |
| 59 | + WHERE |
| 60 | + col_varchar_1024__undef_signed_not_null LIKE 'ok' |
| 61 | + OR col_int_undef_signed_index_inverted = 0; |
| 62 | + """ |
| 63 | +} |
0 commit comments