Coverage Report

Created: 2025-10-11 19:11

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/root/doris/be/src/vec/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
#include "vec/exprs/vexpr.h"
22
23
namespace doris::vectorized {
24
25
class VSearchExpr : public VExpr {
26
public:
27
    VSearchExpr(const TExprNode& node);
28
77
    ~VSearchExpr() override = default;
29
    Status execute(VExprContext* context, Block* block, int* result_column_id) override;
30
    const std::string& expr_name() const override;
31
    Status evaluate_inverted_index(VExprContext* context, uint32_t segment_num_rows) override;
32
33
    // Override to prevent being treated as constant - search expressions must use inverted index
34
2
    bool is_constant() const override { return false; }
35
36
77
    static VExprSPtr create_shared(const TExprNode& node) {
37
77
        return std::make_shared<VSearchExpr>(node);
38
77
    }
39
40
0
    bool can_push_down_to_index() const override { return true; }
41
42
private:
43
    TSearchParam _search_param;
44
    std::string _original_dsl;
45
};
46
47
} // namespace doris::vectorized