airborne12 commented on code in PR #38908: URL: https://github.com/apache/doris/pull/38908#discussion_r1719261666
########## be/src/olap/rowset/segment_v2/segment_iterator.cpp: ########## @@ -977,74 +794,20 @@ bool SegmentIterator::_check_apply_by_inverted_index(ColumnPredicate* pred, bool return true; } -Status SegmentIterator::_apply_inverted_index_except_leafnode_of_andnode( - ColumnPredicate* pred, roaring::Roaring* output_result) { - RETURN_IF_ERROR(pred->evaluate(_storage_name_and_type[pred->column_id()], - _inverted_index_iterators[pred->column_id()].get(), num_rows(), - output_result)); - return Status::OK(); -} - -Status SegmentIterator::_apply_index_except_leafnode_of_andnode() { - for (auto* pred : _col_preds_except_leafnode_of_andnode) { - auto column_id = pred->column_id(); - auto pred_type = pred->type(); - bool is_support = pred_type == PredicateType::EQ || pred_type == PredicateType::NE || - pred_type == PredicateType::LT || pred_type == PredicateType::LE || - pred_type == PredicateType::GT || pred_type == PredicateType::GE || - pred_type == PredicateType::MATCH || - pred_type == PredicateType::IN_LIST || - pred_type == PredicateType::NOT_IN_LIST; - if (!is_support) { - continue; - } - - bool can_apply_by_inverted_index = _check_apply_by_inverted_index(pred, true); - roaring::Roaring bitmap = _row_bitmap; - Status res = Status::OK(); - if (can_apply_by_inverted_index) { - res = _apply_inverted_index_except_leafnode_of_andnode(pred, &bitmap); - } else { - continue; - } - - bool need_remaining_after_evaluate = _column_has_fulltext_index(column_id) && - PredicateTypeTraits::is_equal_or_list(pred_type); - if (!res.ok()) { - if (_downgrade_without_index(res, need_remaining_after_evaluate)) { - // downgrade without index query - _not_apply_index_pred.insert(column_id); +Status SegmentIterator::_apply_index_expr() { + for (const auto& expr_ctx : _common_expr_ctxs_push_down) { + if (Status st = expr_ctx->evaluate_inverted_index(num_rows()); !st.ok()) { + if (_downgrade_without_index(st) || st.code() == ErrorCode::NOT_IMPLEMENTED_ERROR) { Review Comment: No, we need to deal with it seperately in the future. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org