Coverage Report

Created: 2026-03-11 11:20

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/root/doris/be/src/exprs/vsearch.h
Line
Count
Source
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
18
#pragma once
19
20
#include <gen_cpp/Exprs_types.h>
21
22
#include "exprs/vexpr.h"
23
24
namespace doris {
25
26
class VSearchExpr : public VExpr {
27
public:
28
    VSearchExpr(const TExprNode& node);
29
78
    ~VSearchExpr() override = default;
30
    Status execute_column(VExprContext* context, const Block* block, Selector* selector,
31
                          size_t count, ColumnPtr& result_column) const override;
32
    const std::string& expr_name() const override;
33
    Status evaluate_inverted_index(VExprContext* context, uint32_t segment_num_rows) override;
34
35
    // Override to prevent being treated as constant - search expressions must use inverted index
36
2
    bool is_constant() const override { return false; }
37
38
78
    static VExprSPtr create_shared(const TExprNode& node) {
39
78
        return std::make_shared<VSearchExpr>(node);
40
78
    }
41
42
0
    bool can_push_down_to_index() const override { return true; }
43
44
5
    const TSearchParam& get_search_param() const { return _search_param; }
45
0
    bool enable_cache() const { return _enable_cache; }
46
47
    Status prepare(RuntimeState* state, const RowDescriptor& row_desc,
48
                   VExprContext* context) override;
49
50
private:
51
    TSearchParam _search_param;
52
    std::string _original_dsl;
53
    bool _enable_cache = true;
54
};
55
56
} // namespace doris