Coverage Report

Created: 2026-07-02 13:17

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exprs/function/array/function_arrays_overlap.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
#pragma once
18
19
#include <fmt/format.h>
20
#include <glog/logging.h>
21
#include <sys/types.h>
22
23
#include <boost/iterator/iterator_facade.hpp>
24
#include <memory>
25
#include <ostream>
26
#include <utility>
27
28
#include "common/status.h"
29
#include "core/assert_cast.h"
30
#include "core/block/block.h"
31
#include "core/block/column_numbers.h"
32
#include "core/block/column_with_type_and_name.h"
33
#include "core/column/column.h"
34
#include "core/column/column_array_view.h"
35
#include "core/column/column_nullable.h"
36
#include "core/column/column_vector.h"
37
#include "core/data_type/data_type.h"
38
#include "core/data_type/data_type_array.h"
39
#include "core/data_type/data_type_nullable.h"
40
#include "core/data_type/data_type_number.h"
41
#include "core/string_ref.h"
42
#include "core/types.h"
43
#include "exec/common/hash_table/hash.h"
44
#include "exprs/function/array/function_array_index.h"
45
#include "exprs/function/array/function_array_utils.h"
46
#include "exprs/function/function.h"
47
#include "exprs/function/function_helpers.h"
48
49
namespace doris {
50
class FunctionContext;
51
} // namespace doris
52
template <typename, typename>
53
struct DefaultHash;
54
55
namespace doris {
56
57
template <typename T>
58
class ColumnStr;
59
using ColumnString = ColumnStr<UInt32>;
60
61
template <PrimitiveType PType>
62
struct OverlapSetImpl {
63
    using ArrayView = ArrayDataView<PType>;
64
    using ElementNativeType =
65
            typename NativeType<typename PrimitiveTypeTraits<PType>::ColumnType::value_type>::Type;
66
    using Set = phmap::flat_hash_set<ElementNativeType, DefaultHash<ElementNativeType>>;
67
    Set set;
68
    bool has_null = false;
69
70
5
    void insert_array(const ArrayView& array) {
71
12
        for (size_t i = 0; i < array.size(); ++i) {
72
7
            if (array.is_null_at(i)) {
73
1
                has_null = true;
74
1
                continue;
75
1
            }
76
6
            set.insert(array.value_at(i));
77
6
        }
78
5
    }
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE2EE12insert_arrayERKNS_13ArrayDataViewILS1_2EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE3EE12insert_arrayERKNS_13ArrayDataViewILS1_3EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE4EE12insert_arrayERKNS_13ArrayDataViewILS1_4EEE
_ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE5EE12insert_arrayERKNS_13ArrayDataViewILS1_5EEE
Line
Count
Source
70
3
    void insert_array(const ArrayView& array) {
71
8
        for (size_t i = 0; i < array.size(); ++i) {
72
5
            if (array.is_null_at(i)) {
73
1
                has_null = true;
74
1
                continue;
75
1
            }
76
4
            set.insert(array.value_at(i));
77
4
        }
78
3
    }
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE6EE12insert_arrayERKNS_13ArrayDataViewILS1_6EEE
_ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE7EE12insert_arrayERKNS_13ArrayDataViewILS1_7EEE
Line
Count
Source
70
1
    void insert_array(const ArrayView& array) {
71
2
        for (size_t i = 0; i < array.size(); ++i) {
72
1
            if (array.is_null_at(i)) {
73
0
                has_null = true;
74
0
                continue;
75
0
            }
76
1
            set.insert(array.value_at(i));
77
1
        }
78
1
    }
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE8EE12insert_arrayERKNS_13ArrayDataViewILS1_8EEE
_ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE9EE12insert_arrayERKNS_13ArrayDataViewILS1_9EEE
Line
Count
Source
70
1
    void insert_array(const ArrayView& array) {
71
2
        for (size_t i = 0; i < array.size(); ++i) {
72
1
            if (array.is_null_at(i)) {
73
0
                has_null = true;
74
0
                continue;
75
0
            }
76
1
            set.insert(array.value_at(i));
77
1
        }
78
1
    }
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE28EE12insert_arrayERKNS_13ArrayDataViewILS1_28EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE29EE12insert_arrayERKNS_13ArrayDataViewILS1_29EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE30EE12insert_arrayERKNS_13ArrayDataViewILS1_30EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE35EE12insert_arrayERKNS_13ArrayDataViewILS1_35EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE11EE12insert_arrayERKNS_13ArrayDataViewILS1_11EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE25EE12insert_arrayERKNS_13ArrayDataViewILS1_25EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE26EE12insert_arrayERKNS_13ArrayDataViewILS1_26EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE12EE12insert_arrayERKNS_13ArrayDataViewILS1_12EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE27EE12insert_arrayERKNS_13ArrayDataViewILS1_27EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE42EE12insert_arrayERKNS_13ArrayDataViewILS1_42EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE36EE12insert_arrayERKNS_13ArrayDataViewILS1_36EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE37EE12insert_arrayERKNS_13ArrayDataViewILS1_37EEE
79
80
5
    bool find_any(const ArrayView& array) {
81
11
        for (size_t i = 0; i < array.size(); ++i) {
82
10
            if (array.is_null_at(i)) {
83
1
                if (has_null) {
84
1
                    return true;
85
1
                } else {
86
0
                    continue;
87
0
                }
88
1
            }
89
90
9
            if (set.contains(array.value_at(i))) {
91
3
                return true;
92
3
            }
93
9
        }
94
1
        return false;
95
5
    }
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE2EE8find_anyERKNS_13ArrayDataViewILS1_2EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE3EE8find_anyERKNS_13ArrayDataViewILS1_3EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE4EE8find_anyERKNS_13ArrayDataViewILS1_4EEE
_ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE5EE8find_anyERKNS_13ArrayDataViewILS1_5EEE
Line
Count
Source
80
3
    bool find_any(const ArrayView& array) {
81
9
        for (size_t i = 0; i < array.size(); ++i) {
82
8
            if (array.is_null_at(i)) {
83
1
                if (has_null) {
84
1
                    return true;
85
1
                } else {
86
0
                    continue;
87
0
                }
88
1
            }
89
90
7
            if (set.contains(array.value_at(i))) {
91
1
                return true;
92
1
            }
93
7
        }
94
1
        return false;
95
3
    }
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE6EE8find_anyERKNS_13ArrayDataViewILS1_6EEE
_ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE7EE8find_anyERKNS_13ArrayDataViewILS1_7EEE
Line
Count
Source
80
1
    bool find_any(const ArrayView& array) {
81
1
        for (size_t i = 0; i < array.size(); ++i) {
82
1
            if (array.is_null_at(i)) {
83
0
                if (has_null) {
84
0
                    return true;
85
0
                } else {
86
0
                    continue;
87
0
                }
88
0
            }
89
90
1
            if (set.contains(array.value_at(i))) {
91
1
                return true;
92
1
            }
93
1
        }
94
0
        return false;
95
1
    }
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE8EE8find_anyERKNS_13ArrayDataViewILS1_8EEE
_ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE9EE8find_anyERKNS_13ArrayDataViewILS1_9EEE
Line
Count
Source
80
1
    bool find_any(const ArrayView& array) {
81
1
        for (size_t i = 0; i < array.size(); ++i) {
82
1
            if (array.is_null_at(i)) {
83
0
                if (has_null) {
84
0
                    return true;
85
0
                } else {
86
0
                    continue;
87
0
                }
88
0
            }
89
90
1
            if (set.contains(array.value_at(i))) {
91
1
                return true;
92
1
            }
93
1
        }
94
0
        return false;
95
1
    }
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE28EE8find_anyERKNS_13ArrayDataViewILS1_28EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE29EE8find_anyERKNS_13ArrayDataViewILS1_29EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE30EE8find_anyERKNS_13ArrayDataViewILS1_30EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE35EE8find_anyERKNS_13ArrayDataViewILS1_35EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE11EE8find_anyERKNS_13ArrayDataViewILS1_11EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE25EE8find_anyERKNS_13ArrayDataViewILS1_25EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE26EE8find_anyERKNS_13ArrayDataViewILS1_26EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE12EE8find_anyERKNS_13ArrayDataViewILS1_12EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE27EE8find_anyERKNS_13ArrayDataViewILS1_27EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE42EE8find_anyERKNS_13ArrayDataViewILS1_42EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE36EE8find_anyERKNS_13ArrayDataViewILS1_36EEE
Unexecuted instantiation: _ZN5doris14OverlapSetImplILNS_13PrimitiveTypeE37EE8find_anyERKNS_13ArrayDataViewILS1_37EEE
96
};
97
98
template <>
99
struct OverlapSetImpl<TYPE_DECIMALV2> {
100
    using ArrayView = ArrayDataView<TYPE_DECIMALV2>;
101
    using ElementNativeType = Int128;
102
    using Set = phmap::flat_hash_set<ElementNativeType, DefaultHash<ElementNativeType>>;
103
    Set set;
104
    bool has_null = false;
105
106
10
    void insert_array(const ArrayView& array) {
107
20
        for (size_t i = 0; i < array.size(); ++i) {
108
10
            if (array.is_null_at(i)) {
109
0
                has_null = true;
110
0
                continue;
111
0
            }
112
10
            set.insert(array.value_at(i).value());
113
10
        }
114
10
    }
115
116
10
    bool find_any(const ArrayView& array) {
117
24
        for (size_t i = 0; i < array.size(); ++i) {
118
20
            if (array.is_null_at(i)) {
119
2
                if (has_null) {
120
0
                    return true;
121
2
                } else {
122
2
                    continue;
123
2
                }
124
2
            }
125
126
18
            if (set.contains(array.value_at(i).value())) {
127
6
                return true;
128
6
            }
129
18
        }
130
4
        return false;
131
10
    }
132
};
133
134
template <>
135
struct OverlapSetImpl<TYPE_STRING> {
136
    using ArrayView = ArrayDataView<TYPE_STRING>;
137
    using Set = phmap::flat_hash_set<StringRef, DefaultHash<StringRef>>;
138
    Set set;
139
    bool has_null = false;
140
141
14
    void insert_array(const ArrayView& array) {
142
34
        for (size_t i = 0; i < array.size(); ++i) {
143
20
            if (array.is_null_at(i)) {
144
5
                has_null = true;
145
5
                continue;
146
5
            }
147
15
            set.insert(array.value_at(i));
148
15
        }
149
14
    }
150
151
14
    bool find_any(const ArrayView& array) {
152
29
        for (size_t i = 0; i < array.size(); ++i) {
153
25
            if (array.is_null_at(i)) {
154
0
                if (has_null) {
155
0
                    return true;
156
0
                } else {
157
0
                    continue;
158
0
                }
159
0
            }
160
161
25
            if (set.contains(array.value_at(i))) {
162
10
                return true;
163
10
            }
164
25
        }
165
4
        return false;
166
14
    }
167
};
168
169
class FunctionArraysOverlap : public IFunction {
170
public:
171
    static constexpr auto name = "arrays_overlap";
172
11
    static FunctionPtr create() { return std::make_shared<FunctionArraysOverlap>(); }
173
174
    /// Get function name.
175
10
    String get_name() const override { return name; }
176
177
18
    bool use_default_implementation_for_nulls() const override { return false; }
178
179
10
    bool is_variadic() const override { return false; }
180
181
9
    size_t get_number_of_arguments() const override { return 2; }
182
183
9
    DataTypePtr get_return_type_impl(const DataTypes& arguments) const override {
184
9
        auto left_data_type = remove_nullable(arguments[0]);
185
9
        auto right_data_type = remove_nullable(arguments[1]);
186
9
        DCHECK(left_data_type->get_primitive_type() == TYPE_ARRAY) << arguments[0]->get_name();
187
9
        DCHECK(right_data_type->get_primitive_type() == TYPE_ARRAY) << arguments[1]->get_name();
188
9
        auto left_nested_type = remove_nullable(
189
9
                assert_cast<const DataTypeArray&>(*left_data_type).get_nested_type());
190
9
        auto right_nested_type = remove_nullable(
191
9
                assert_cast<const DataTypeArray&>(*right_data_type).get_nested_type());
192
9
        DCHECK(left_nested_type->equals_ignore_precision(*right_nested_type))
193
0
                << "data type " << arguments[0]->get_name() << " not equal with "
194
0
                << arguments[1]->get_name();
195
9
        return make_nullable(std::make_shared<DataTypeUInt8>());
196
9
    }
197
198
    /**
199
     * eval inverted index. we can filter array rows with inverted index iter
200
     * array_overlap(array, []) -> array_overlap(array, const value)
201
     */
202
    Status evaluate_inverted_index(
203
            const ColumnsWithTypeAndName& arguments,
204
            const std::vector<IndexFieldNameAndTypePair>& data_type_with_names,
205
            std::vector<segment_v2::IndexIterator*> iterators, uint32_t num_rows,
206
            const InvertedIndexAnalyzerCtx* analyzer_ctx,
207
0
            segment_v2::InvertedIndexResultBitmap& bitmap_result) const override {
208
0
        DCHECK(arguments.size() == 1);
209
0
        DCHECK(data_type_with_names.size() == 1);
210
0
        DCHECK(iterators.size() == 1);
211
0
        auto* iter = iterators[0];
212
0
        if (iter == nullptr) {
213
0
            return Status::OK();
214
0
        }
215
0
        auto data_type_with_name = data_type_with_names[0];
216
0
        if (!segment_v2::IndexReaderHelper::has_string_or_bkd_index(iter)) {
217
0
            return Status::Error<ErrorCode::INVERTED_INDEX_EVALUATE_SKIPPED>(
218
0
                    "Inverted index evaluate skipped, no inverted index reader can not support "
219
0
                    "array_overlap");
220
0
        }
221
        // in arrays_overlap param is array Field and const Field
222
0
        ColumnPtr arg_column = arguments[0].column;
223
0
        DataTypePtr arg_type = arguments[0].type;
224
0
        if ((is_column_nullable(*arg_column) && !is_column_const(*remove_nullable(arg_column))) ||
225
0
            (!is_column_nullable(*arg_column) && !is_column_const(*arg_column))) {
226
            // if not we should skip inverted index and evaluate in expression
227
0
            return Status::Error<ErrorCode::INVERTED_INDEX_EVALUATE_SKIPPED>(
228
0
                    "Inverted index evaluate skipped, array_overlap only support const value");
229
0
        }
230
231
0
        Field param_value;
232
0
        arguments[0].column->get(0, param_value);
233
0
        DCHECK(arguments[0].type->get_primitive_type() == TYPE_ARRAY);
234
        // The current implementation for the inverted index of arrays cannot handle cases where the array contains null values,
235
        // meaning an item in the array is null.
236
0
        if (param_value.is_null()) {
237
0
            return Status::OK();
238
0
        }
239
0
        std::shared_ptr<roaring::Roaring> roaring = std::make_shared<roaring::Roaring>();
240
0
        std::shared_ptr<roaring::Roaring> null_bitmap = std::make_shared<roaring::Roaring>();
241
0
        if (iter->has_null()) {
242
0
            segment_v2::InvertedIndexQueryCacheHandle null_bitmap_cache_handle;
243
0
            RETURN_IF_ERROR(iter->read_null_bitmap(&null_bitmap_cache_handle));
244
0
            null_bitmap = null_bitmap_cache_handle.get_bitmap();
245
0
        }
246
0
        const Array& query_val = param_value.get<TYPE_ARRAY>();
247
248
0
        InvertedIndexParam param;
249
0
        param.column_name = data_type_with_name.first;
250
0
        param.column_type = data_type_with_name.second;
251
0
        param.query_type = segment_v2::InvertedIndexQueryType::EQUAL_QUERY;
252
0
        param.num_rows = num_rows;
253
0
        for (auto nested_query_val : query_val) {
254
            // any element inside array is NULL, return NULL
255
            // by current arrays_overlap execute logic.
256
0
            if (nested_query_val.is_null()) {
257
0
                return Status::OK();
258
0
            }
259
0
            param.query_value = nested_query_val;
260
0
            param.roaring = std::make_shared<roaring::Roaring>();
261
0
            param.analyzer_ctx = analyzer_ctx;
262
0
            RETURN_IF_ERROR(iter->read_from_index(segment_v2::IndexParam {&param}));
263
0
            *roaring |= *param.roaring;
264
0
        }
265
266
0
        segment_v2::InvertedIndexResultBitmap result(roaring, null_bitmap);
267
0
        bitmap_result = result;
268
0
        bitmap_result.mask_out_null();
269
270
0
        return Status::OK();
271
0
    }
272
273
    Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
274
9
                        uint32_t result, size_t input_rows_count) const override {
275
9
        DBUG_EXECUTE_IF("array_func.arrays_overlap", {
276
9
            auto req_id = DebugPoints::instance()->get_debug_param_or_default<int32_t>(
277
9
                    "array_func.arrays_overlap", "req_id", 0);
278
9
            return Status::Error<ErrorCode::INTERNAL_ERROR>(
279
9
                    "{} has already execute inverted index req_id {} , should not execute expr "
280
9
                    "with rows: {}",
281
9
                    get_name(), req_id, input_rows_count);
282
9
        });
283
9
        Status ret = Status::InvalidArgument(
284
9
                "execute failed, unsupported types for function {}({}, {})", get_name(),
285
9
                block.get_by_position(arguments[0]).type->get_name(),
286
9
                block.get_by_position(arguments[1]).type->get_name());
287
        // prepare return column
288
9
        auto dst_nested_col = ColumnUInt8::create(input_rows_count, 0);
289
9
        auto dst_null_map = ColumnUInt8::create(input_rows_count, 0);
290
9
        UInt8* dst_null_map_data = dst_null_map->get_data().data();
291
292
        // execute overlap check
293
9
        auto array_type = remove_nullable(block.get_by_position(arguments[0]).type);
294
9
        auto left_element_type = remove_nullable(
295
9
                assert_cast<const DataTypeArray*>(array_type.get())->get_nested_type());
296
297
9
        auto call = [&](const auto& type) -> bool {
298
9
            using DispatchType = std::decay_t<decltype(type)>;
299
9
            constexpr PrimitiveType PType = DispatchType::PType;
300
9
            auto left_view =
301
9
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column);
302
9
            auto right_view =
303
9
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[1]).column);
304
9
            ret = _execute_internal<PType>(left_view, right_view, dst_null_map_data,
305
9
                                           dst_nested_col->get_data().data());
306
9
            return true;
307
9
        };
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE2EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE3EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE4EEEEEbSC_
_ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE5EEEEEbSC_
Line
Count
Source
297
2
        auto call = [&](const auto& type) -> bool {
298
2
            using DispatchType = std::decay_t<decltype(type)>;
299
2
            constexpr PrimitiveType PType = DispatchType::PType;
300
2
            auto left_view =
301
2
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column);
302
2
            auto right_view =
303
2
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[1]).column);
304
2
            ret = _execute_internal<PType>(left_view, right_view, dst_null_map_data,
305
2
                                           dst_nested_col->get_data().data());
306
2
            return true;
307
2
        };
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE6EEEEEbSC_
_ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE7EEEEEbSC_
Line
Count
Source
297
1
        auto call = [&](const auto& type) -> bool {
298
1
            using DispatchType = std::decay_t<decltype(type)>;
299
1
            constexpr PrimitiveType PType = DispatchType::PType;
300
1
            auto left_view =
301
1
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column);
302
1
            auto right_view =
303
1
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[1]).column);
304
1
            ret = _execute_internal<PType>(left_view, right_view, dst_null_map_data,
305
1
                                           dst_nested_col->get_data().data());
306
1
            return true;
307
1
        };
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE8EEEEEbSC_
_ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE9EEEEEbSC_
Line
Count
Source
297
1
        auto call = [&](const auto& type) -> bool {
298
1
            using DispatchType = std::decay_t<decltype(type)>;
299
1
            constexpr PrimitiveType PType = DispatchType::PType;
300
1
            auto left_view =
301
1
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column);
302
1
            auto right_view =
303
1
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[1]).column);
304
1
            ret = _execute_internal<PType>(left_view, right_view, dst_null_map_data,
305
1
                                           dst_nested_col->get_data().data());
306
1
            return true;
307
1
        };
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE28EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE29EEEEEbSC_
_ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE20EEEEEbSC_
Line
Count
Source
297
2
        auto call = [&](const auto& type) -> bool {
298
2
            using DispatchType = std::decay_t<decltype(type)>;
299
2
            constexpr PrimitiveType PType = DispatchType::PType;
300
2
            auto left_view =
301
2
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column);
302
2
            auto right_view =
303
2
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[1]).column);
304
2
            ret = _execute_internal<PType>(left_view, right_view, dst_null_map_data,
305
2
                                           dst_nested_col->get_data().data());
306
2
            return true;
307
2
        };
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE30EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE35EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE11EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE25EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE26EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE12EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE27EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE42EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE36EEEEEbSC_
Unexecuted instantiation: _ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE37EEEEEbSC_
_ZZNK5doris21FunctionArraysOverlap12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjmENKUlRKT_E_clINS_16DispatchDataTypeILNS_13PrimitiveTypeE23EEEEEbSC_
Line
Count
Source
297
3
        auto call = [&](const auto& type) -> bool {
298
3
            using DispatchType = std::decay_t<decltype(type)>;
299
3
            constexpr PrimitiveType PType = DispatchType::PType;
300
3
            auto left_view =
301
3
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[0]).column);
302
3
            auto right_view =
303
3
                    ColumnArrayView<PType>::create(block.get_by_position(arguments[1]).column);
304
3
            ret = _execute_internal<PType>(left_view, right_view, dst_null_map_data,
305
3
                                           dst_nested_col->get_data().data());
306
3
            return true;
307
3
        };
308
9
        if (!dispatch_switch_all(left_element_type->get_primitive_type(), call)) {
309
0
            ret = Status::InvalidArgument("execute failed, not support type {} in function {}",
310
0
                                          left_element_type->get_name(), get_name());
311
0
        }
312
313
9
        RETURN_IF_ERROR(ret);
314
315
9
        block.replace_by_position(
316
9
                result, ColumnNullable::create(std::move(dst_nested_col), std::move(dst_null_map)));
317
318
9
        return Status::OK();
319
9
    }
320
321
private:
322
    template <PrimitiveType PType>
323
18
    static Status _execute_nullable(const ColumnArrayView<PType>& data, UInt8* dst_nullmap_data) {
324
102
        for (ssize_t row = 0; row < data.size(); ++row) {
325
84
            if (dst_nullmap_data[row]) {
326
5
                continue;
327
5
            }
328
329
79
            if (data.is_null_at(row)) {
330
6
                dst_nullmap_data[row] = 1;
331
6
                continue;
332
6
            }
333
79
        }
334
18
        return Status::OK();
335
18
    }
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE2EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE3EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE4EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
_ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE5EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Line
Count
Source
323
4
    static Status _execute_nullable(const ColumnArrayView<PType>& data, UInt8* dst_nullmap_data) {
324
14
        for (ssize_t row = 0; row < data.size(); ++row) {
325
10
            if (dst_nullmap_data[row]) {
326
1
                continue;
327
1
            }
328
329
9
            if (data.is_null_at(row)) {
330
1
                dst_nullmap_data[row] = 1;
331
1
                continue;
332
1
            }
333
9
        }
334
4
        return Status::OK();
335
4
    }
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE6EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
_ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE7EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Line
Count
Source
323
2
    static Status _execute_nullable(const ColumnArrayView<PType>& data, UInt8* dst_nullmap_data) {
324
8
        for (ssize_t row = 0; row < data.size(); ++row) {
325
6
            if (dst_nullmap_data[row]) {
326
1
                continue;
327
1
            }
328
329
5
            if (data.is_null_at(row)) {
330
1
                dst_nullmap_data[row] = 1;
331
1
                continue;
332
1
            }
333
5
        }
334
2
        return Status::OK();
335
2
    }
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE8EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
_ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE9EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Line
Count
Source
323
2
    static Status _execute_nullable(const ColumnArrayView<PType>& data, UInt8* dst_nullmap_data) {
324
8
        for (ssize_t row = 0; row < data.size(); ++row) {
325
6
            if (dst_nullmap_data[row]) {
326
1
                continue;
327
1
            }
328
329
5
            if (data.is_null_at(row)) {
330
1
                dst_nullmap_data[row] = 1;
331
1
                continue;
332
1
            }
333
5
        }
334
2
        return Status::OK();
335
2
    }
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE28EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE29EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
_ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE20EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Line
Count
Source
323
4
    static Status _execute_nullable(const ColumnArrayView<PType>& data, UInt8* dst_nullmap_data) {
324
32
        for (ssize_t row = 0; row < data.size(); ++row) {
325
28
            if (dst_nullmap_data[row]) {
326
1
                continue;
327
1
            }
328
329
27
            if (data.is_null_at(row)) {
330
2
                dst_nullmap_data[row] = 1;
331
2
                continue;
332
2
            }
333
27
        }
334
4
        return Status::OK();
335
4
    }
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE30EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE35EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE11EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE25EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE26EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE12EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE27EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE42EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE36EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Unexecuted instantiation: _ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE37EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
_ZN5doris21FunctionArraysOverlap17_execute_nullableILNS_13PrimitiveTypeE23EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEEPh
Line
Count
Source
323
6
    static Status _execute_nullable(const ColumnArrayView<PType>& data, UInt8* dst_nullmap_data) {
324
40
        for (ssize_t row = 0; row < data.size(); ++row) {
325
34
            if (dst_nullmap_data[row]) {
326
1
                continue;
327
1
            }
328
329
33
            if (data.is_null_at(row)) {
330
1
                dst_nullmap_data[row] = 1;
331
1
                continue;
332
1
            }
333
33
        }
334
6
        return Status::OK();
335
6
    }
336
337
    template <PrimitiveType PType>
338
    Status _execute_internal(const ColumnArrayView<PType>& left_data,
339
                             const ColumnArrayView<PType>& right_data, UInt8* dst_nullmap_data,
340
9
                             UInt8* dst_data) const {
341
9
        using ExecutorImpl = OverlapSetImpl<PType>;
342
9
        RETURN_IF_ERROR(_execute_nullable(left_data, dst_nullmap_data));
343
9
        RETURN_IF_ERROR(_execute_nullable(right_data, dst_nullmap_data));
344
51
        for (ssize_t row = 0; row < left_data.size(); ++row) {
345
            // arrays_overlap(null, null) -> null
346
42
            if (dst_nullmap_data[row]) {
347
6
                continue;
348
6
            }
349
36
            dst_nullmap_data[row] = 0;
350
36
            const auto left_array = left_data[row];
351
36
            const auto right_array = right_data[row];
352
36
            if (left_array.size() == 0 || right_array.size() == 0) {
353
7
                dst_data[row] = 0;
354
7
                continue;
355
7
            }
356
357
29
            const auto& small_data =
358
29
                    right_array.size() < left_array.size() ? right_array : left_array;
359
29
            const auto& large_data =
360
29
                    right_array.size() < left_array.size() ? left_array : right_array;
361
362
29
            ExecutorImpl impl;
363
29
            impl.insert_array(small_data);
364
29
            dst_data[row] = impl.find_any(large_data);
365
29
        }
366
9
        return Status::OK();
367
9
    }
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE2EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE3EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE4EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
_ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE5EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Line
Count
Source
340
2
                             UInt8* dst_data) const {
341
2
        using ExecutorImpl = OverlapSetImpl<PType>;
342
2
        RETURN_IF_ERROR(_execute_nullable(left_data, dst_nullmap_data));
343
2
        RETURN_IF_ERROR(_execute_nullable(right_data, dst_nullmap_data));
344
7
        for (ssize_t row = 0; row < left_data.size(); ++row) {
345
            // arrays_overlap(null, null) -> null
346
5
            if (dst_nullmap_data[row]) {
347
1
                continue;
348
1
            }
349
4
            dst_nullmap_data[row] = 0;
350
4
            const auto left_array = left_data[row];
351
4
            const auto right_array = right_data[row];
352
4
            if (left_array.size() == 0 || right_array.size() == 0) {
353
1
                dst_data[row] = 0;
354
1
                continue;
355
1
            }
356
357
3
            const auto& small_data =
358
3
                    right_array.size() < left_array.size() ? right_array : left_array;
359
3
            const auto& large_data =
360
3
                    right_array.size() < left_array.size() ? left_array : right_array;
361
362
3
            ExecutorImpl impl;
363
3
            impl.insert_array(small_data);
364
3
            dst_data[row] = impl.find_any(large_data);
365
3
        }
366
2
        return Status::OK();
367
2
    }
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE6EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
_ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE7EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Line
Count
Source
340
1
                             UInt8* dst_data) const {
341
1
        using ExecutorImpl = OverlapSetImpl<PType>;
342
1
        RETURN_IF_ERROR(_execute_nullable(left_data, dst_nullmap_data));
343
1
        RETURN_IF_ERROR(_execute_nullable(right_data, dst_nullmap_data));
344
4
        for (ssize_t row = 0; row < left_data.size(); ++row) {
345
            // arrays_overlap(null, null) -> null
346
3
            if (dst_nullmap_data[row]) {
347
1
                continue;
348
1
            }
349
2
            dst_nullmap_data[row] = 0;
350
2
            const auto left_array = left_data[row];
351
2
            const auto right_array = right_data[row];
352
2
            if (left_array.size() == 0 || right_array.size() == 0) {
353
1
                dst_data[row] = 0;
354
1
                continue;
355
1
            }
356
357
1
            const auto& small_data =
358
1
                    right_array.size() < left_array.size() ? right_array : left_array;
359
1
            const auto& large_data =
360
1
                    right_array.size() < left_array.size() ? left_array : right_array;
361
362
1
            ExecutorImpl impl;
363
1
            impl.insert_array(small_data);
364
1
            dst_data[row] = impl.find_any(large_data);
365
1
        }
366
1
        return Status::OK();
367
1
    }
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE8EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
_ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE9EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Line
Count
Source
340
1
                             UInt8* dst_data) const {
341
1
        using ExecutorImpl = OverlapSetImpl<PType>;
342
1
        RETURN_IF_ERROR(_execute_nullable(left_data, dst_nullmap_data));
343
1
        RETURN_IF_ERROR(_execute_nullable(right_data, dst_nullmap_data));
344
4
        for (ssize_t row = 0; row < left_data.size(); ++row) {
345
            // arrays_overlap(null, null) -> null
346
3
            if (dst_nullmap_data[row]) {
347
1
                continue;
348
1
            }
349
2
            dst_nullmap_data[row] = 0;
350
2
            const auto left_array = left_data[row];
351
2
            const auto right_array = right_data[row];
352
2
            if (left_array.size() == 0 || right_array.size() == 0) {
353
1
                dst_data[row] = 0;
354
1
                continue;
355
1
            }
356
357
1
            const auto& small_data =
358
1
                    right_array.size() < left_array.size() ? right_array : left_array;
359
1
            const auto& large_data =
360
1
                    right_array.size() < left_array.size() ? left_array : right_array;
361
362
1
            ExecutorImpl impl;
363
1
            impl.insert_array(small_data);
364
1
            dst_data[row] = impl.find_any(large_data);
365
1
        }
366
1
        return Status::OK();
367
1
    }
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE28EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE29EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
_ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE20EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Line
Count
Source
340
2
                             UInt8* dst_data) const {
341
2
        using ExecutorImpl = OverlapSetImpl<PType>;
342
2
        RETURN_IF_ERROR(_execute_nullable(left_data, dst_nullmap_data));
343
2
        RETURN_IF_ERROR(_execute_nullable(right_data, dst_nullmap_data));
344
16
        for (ssize_t row = 0; row < left_data.size(); ++row) {
345
            // arrays_overlap(null, null) -> null
346
14
            if (dst_nullmap_data[row]) {
347
2
                continue;
348
2
            }
349
12
            dst_nullmap_data[row] = 0;
350
12
            const auto left_array = left_data[row];
351
12
            const auto right_array = right_data[row];
352
12
            if (left_array.size() == 0 || right_array.size() == 0) {
353
2
                dst_data[row] = 0;
354
2
                continue;
355
2
            }
356
357
10
            const auto& small_data =
358
10
                    right_array.size() < left_array.size() ? right_array : left_array;
359
10
            const auto& large_data =
360
10
                    right_array.size() < left_array.size() ? left_array : right_array;
361
362
10
            ExecutorImpl impl;
363
10
            impl.insert_array(small_data);
364
10
            dst_data[row] = impl.find_any(large_data);
365
10
        }
366
2
        return Status::OK();
367
2
    }
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE30EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE35EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE11EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE25EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE26EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE12EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE27EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE42EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE36EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Unexecuted instantiation: _ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE37EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
_ZNK5doris21FunctionArraysOverlap17_execute_internalILNS_13PrimitiveTypeE23EEENS_6StatusERKNS_15ColumnArrayViewIXT_EEES7_PhS8_
Line
Count
Source
340
3
                             UInt8* dst_data) const {
341
3
        using ExecutorImpl = OverlapSetImpl<PType>;
342
3
        RETURN_IF_ERROR(_execute_nullable(left_data, dst_nullmap_data));
343
3
        RETURN_IF_ERROR(_execute_nullable(right_data, dst_nullmap_data));
344
20
        for (ssize_t row = 0; row < left_data.size(); ++row) {
345
            // arrays_overlap(null, null) -> null
346
17
            if (dst_nullmap_data[row]) {
347
1
                continue;
348
1
            }
349
16
            dst_nullmap_data[row] = 0;
350
16
            const auto left_array = left_data[row];
351
16
            const auto right_array = right_data[row];
352
16
            if (left_array.size() == 0 || right_array.size() == 0) {
353
2
                dst_data[row] = 0;
354
2
                continue;
355
2
            }
356
357
14
            const auto& small_data =
358
14
                    right_array.size() < left_array.size() ? right_array : left_array;
359
14
            const auto& large_data =
360
14
                    right_array.size() < left_array.size() ? left_array : right_array;
361
362
14
            ExecutorImpl impl;
363
14
            impl.insert_array(small_data);
364
14
            dst_data[row] = impl.find_any(large_data);
365
14
        }
366
3
        return Status::OK();
367
3
    }
368
};
369
370
} // namespace doris