be/src/exprs/function/function_multi_match.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 <boost/algorithm/string/split.hpp> |
21 | | |
22 | | #include "core/data_type/data_type.h" |
23 | | #include "core/data_type/data_type_array.h" |
24 | | #include "core/data_type/data_type_number.h" |
25 | | #include "exprs/function/function.h" |
26 | | |
27 | | namespace doris { |
28 | | |
29 | | class FunctionMultiMatch : public IFunction { |
30 | | public: |
31 | | static constexpr auto name = "multi_match"; |
32 | | |
33 | 41 | static FunctionPtr create() { return std::make_shared<FunctionMultiMatch>(); } |
34 | | using NullMapType = PaddedPODArray<UInt8>; |
35 | | |
36 | 0 | String get_name() const override { return name; } |
37 | | |
38 | 33 | bool is_variadic() const override { return true; } |
39 | | |
40 | 0 | size_t get_number_of_arguments() const override { return 0; } |
41 | | |
42 | 32 | bool use_default_implementation_for_nulls() const override { return false; } |
43 | | |
44 | 32 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
45 | 32 | return std::make_shared<DataTypeUInt8>(); |
46 | 32 | } |
47 | | |
48 | | Status execute_impl(FunctionContext* /*context*/, Block& block, const ColumnNumbers& arguments, |
49 | | uint32_t result, size_t /*input_rows_count*/) const override; |
50 | | |
51 | 0 | bool can_push_down_to_index() const override { return true; } |
52 | | |
53 | | Status evaluate_inverted_index( |
54 | | const ColumnsWithTypeAndName& arguments, |
55 | | const std::vector<IndexFieldNameAndTypePair>& data_type_with_names, |
56 | | std::vector<segment_v2::IndexIterator*> iterators, uint32_t num_rows, |
57 | | const InvertedIndexAnalyzerCtx* analyzer_ctx, |
58 | | segment_v2::InvertedIndexResultBitmap& bitmap_result) const override; |
59 | | }; |
60 | | |
61 | | } // namespace doris |