This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push: new 9829d44f2c8 [fix] (inverted index) fix wrong result in complex compound expr (#40630) (#40631) 9829d44f2c8 is described below commit 9829d44f2c8624627a4d93a18acd2035b91cd228 Author: Sun Chenyang <csun5...@gmail.com> AuthorDate: Wed Sep 11 15:34:39 2024 +0800 [fix] (inverted index) fix wrong result in complex compound expr (#40630) (#40631) --- be/src/olap/rowset/segment_v2/segment_iterator.cpp | 4 ++ .../data/inverted_index_p0/test_index_rqg_bug6.out | 7 +++ .../inverted_index_p0/test_index_rqg_bug6.groovy | 63 ++++++++++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp b/be/src/olap/rowset/segment_v2/segment_iterator.cpp index b337cd8f262..7f9c70be8cc 100644 --- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp +++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp @@ -757,6 +757,10 @@ Status SegmentIterator::_execute_predicates_except_leafnode_of_andnode( _rowid_result_for_index[pred_result_sign].first) { auto apply_result = _rowid_result_for_index[pred_result_sign].second; _pred_except_leafnode_of_andnode_evaluate_result.push_back(apply_result); + } else { + return Status::InvalidArgument( + "_execute_predicates_except_leafnode_of_andnode has no result for {}", + pred_result_sign); } } else if (node_type == TExprNodeType::COMPOUND_PRED) { auto function_name = expr->fn().name.function_name; diff --git a/regression-test/data/inverted_index_p0/test_index_rqg_bug6.out b/regression-test/data/inverted_index_p0/test_index_rqg_bug6.out new file mode 100644 index 00000000000..edf3444ebe2 --- /dev/null +++ b/regression-test/data/inverted_index_p0/test_index_rqg_bug6.out @@ -0,0 +1,7 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !sql -- +1 + +-- !sql_2 -- +3 + diff --git a/regression-test/suites/inverted_index_p0/test_index_rqg_bug6.groovy b/regression-test/suites/inverted_index_p0/test_index_rqg_bug6.groovy new file mode 100644 index 00000000000..ce8e138dfa3 --- /dev/null +++ b/regression-test/suites/inverted_index_p0/test_index_rqg_bug6.groovy @@ -0,0 +1,63 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +suite("test_index_rqg_bug6", "test_index_rqg_bug"){ + def table = "test_index_rqg_bug6" + + sql "drop table if exists ${table}" + + sql """ + create table ${table} ( + pk int, + col_int_undef_signed_index_inverted int not null , + col_varchar_1024__undef_signed_not_null varchar(1024) not null, + INDEX col_int_undef_signed_index_inverted_idx (`col_int_undef_signed_index_inverted`) USING INVERTED, + INDEX col_varchar_1024__undef_signed_not_null_idx (`col_varchar_1024__undef_signed_not_null`) USING INVERTED + ) engine=olap + DUPLICATE KEY(pk) + distributed by hash(pk) buckets 1 + properties("replication_num" = "1"); + """ + + sql """ insert into ${table} values (10, 0, 'ok'), (11, 0, 'oo'), (12, 1, 'ok')""" + + + sql """ sync""" + sql """ set enable_inverted_index_query = true """ + sql """ set inverted_index_skip_threshold = 0 """ + qt_sql """ + SELECT + count() + FROM + test_index_rqg_bug6 + WHERE + IF(col_int_undef_signed_index_inverted = 0, 'true', 'false') = 'false' + AND ( + col_varchar_1024__undef_signed_not_null LIKE 'ok' + OR col_int_undef_signed_index_inverted = 0 + ); + """ + + qt_sql_2 """ + SELECT + count() + FROM + test_index_rqg_bug6 + WHERE + col_varchar_1024__undef_signed_not_null LIKE 'ok' + OR col_int_undef_signed_index_inverted = 0; + """ +} --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org