Coverage Report

Created: 2026-10-09 14:26

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exprs/vcompound_pred.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
#include <gen_cpp/Opcodes_types.h>
20
21
#include <algorithm>
22
#include <cstdint>
23
24
#include "common/logging.h"
25
#include "common/status.h"
26
#include "core/assert_cast.h"
27
#include "core/column/column.h"
28
#include "core/column/column_nullable.h"
29
#include "exprs/vectorized_fn_call.h"
30
#include "exprs/vexpr_context.h"
31
#include "exprs/vexpr_fwd.h"
32
#include "storage/index/zone_map/zonemap_eval_context.h"
33
#include "util/simd/bits.h"
34
35
namespace doris {
36
37
8.94k
inline std::string compound_operator_to_string(TExprOpcode::type op) {
38
8.94k
    if (op == TExprOpcode::COMPOUND_AND) {
39
1.72k
        return "and";
40
7.22k
    } else if (op == TExprOpcode::COMPOUND_OR) {
41
4.84k
        return "or";
42
4.84k
    } else {
43
2.37k
        return "not";
44
2.37k
    }
45
8.94k
}
46
47
205
inline bool inverted_index_status_allows_row_fallback(const Status& status) {
48
205
    DORIS_CHECK(!status.ok());
49
205
    return status.is<ErrorCode::INVERTED_INDEX_BYPASS>() ||
50
205
           status.is<ErrorCode::INVERTED_INDEX_EVALUATE_SKIPPED>() ||
51
205
           status.is<ErrorCode::INVERTED_INDEX_FILE_CORRUPTED>() ||
52
205
           status.is<ErrorCode::INVERTED_INDEX_FILE_NOT_FOUND>() ||
53
205
           status.is<ErrorCode::NOT_IMPLEMENTED_ERROR>();
54
205
}
55
56
class VCompoundPred : public VectorizedFnCall {
57
    ENABLE_FACTORY_CREATOR(VCompoundPred);
58
59
public:
60
8.95k
    VCompoundPred(const TExprNode& node) : VectorizedFnCall(node) {
61
8.95k
        _op = node.opcode;
62
8.95k
        _fn.name.function_name = compound_operator_to_string(_op);
63
8.95k
        _expr_name = fmt::format("VCompoundPredicate[{}](arguments={},return={})",
64
8.95k
                                 _fn.name.function_name, get_child_names(), _data_type->get_name());
65
8.95k
    }
66
67
#ifdef BE_TEST
68
    VCompoundPred() = default;
69
#endif
70
71
14.2k
    const std::string& expr_name() const override { return _expr_name; }
72
8
    Status clone_node(VExprSPtr* cloned_expr) const override {
73
8
        DORIS_CHECK(cloned_expr != nullptr);
74
8
        *cloned_expr = VCompoundPred::create_shared(clone_texpr_node());
75
8
        return Status::OK();
76
8
    }
77
78
    bool can_execute_on_raw_fixed_values(const DataTypePtr& data_type,
79
24
                                         int column_id) const override {
80
24
        return !_children.empty() &&
81
24
               (_op == TExprOpcode::COMPOUND_AND || _op == TExprOpcode::COMPOUND_OR) &&
82
27
               std::ranges::all_of(_children, [&](const VExprSPtr& child) {
83
27
                   return child->can_execute_on_raw_fixed_values(data_type, column_id);
84
27
               });
85
24
    }
86
87
    Status execute_on_raw_fixed_values(const uint8_t* values, size_t num_values, size_t value_width,
88
                                       const DataTypePtr& data_type, int column_id,
89
2
                                       uint8_t* matches) const override {
90
2
        if (!can_execute_on_raw_fixed_values(data_type, column_id)) {
91
0
            return Status::NotSupported("Compound predicate cannot evaluate raw fixed values");
92
0
        }
93
2
        return _execute_raw_compound(
94
4
                num_values, matches, [&](const VExprSPtr& child, uint8_t* child_matches) {
95
4
                    return child->execute_on_raw_fixed_values(values, num_values, value_width,
96
4
                                                              data_type, column_id, child_matches);
97
4
                });
98
2
    }
99
100
    bool can_execute_on_raw_binary_values(const DataTypePtr& data_type,
101
40
                                          int column_id) const override {
102
40
        return !_children.empty() &&
103
40
               (_op == TExprOpcode::COMPOUND_AND || _op == TExprOpcode::COMPOUND_OR) &&
104
80
               std::ranges::all_of(_children, [&](const VExprSPtr& child) {
105
80
                   return child->can_execute_on_raw_binary_values(data_type, column_id);
106
80
               });
107
40
    }
108
109
    Status execute_on_raw_binary_values(const StringRef* values, size_t num_values,
110
                                        const DataTypePtr& data_type, int column_id,
111
8
                                        uint8_t* matches) const override {
112
8
        if (!can_execute_on_raw_binary_values(data_type, column_id)) {
113
0
            return Status::NotSupported("Compound predicate cannot evaluate raw binary values");
114
0
        }
115
8
        return _execute_raw_compound(
116
16
                num_values, matches, [&](const VExprSPtr& child, uint8_t* child_matches) {
117
16
                    return child->execute_on_raw_binary_values(values, num_values, data_type,
118
16
                                                               column_id, child_matches);
119
16
                });
120
8
    }
121
122
12
    bool raw_predicate_result_for_null() const override {
123
12
        if (_op != TExprOpcode::COMPOUND_AND && _op != TExprOpcode::COMPOUND_OR) {
124
            // A Boolean keep bit cannot distinguish FALSE from UNKNOWN, so negating a child's
125
            // collapsed result is not SQL-correct. NOT remains residual and rejects NULL here.
126
0
            return false;
127
0
        }
128
12
        if (_op == TExprOpcode::COMPOUND_AND) {
129
3
            return std::ranges::all_of(_children, [](const VExprSPtr& child) {
130
3
                return child->raw_predicate_result_for_null();
131
3
            });
132
3
        }
133
18
        return std::ranges::any_of(_children, [](const VExprSPtr& child) {
134
18
            return child->raw_predicate_result_for_null();
135
18
        });
136
12
    }
137
138
17.8k
    bool can_evaluate_zonemap_filter() const override {
139
17.8k
        switch (_op) {
140
3.21k
        case TExprOpcode::COMPOUND_AND:
141
3.72k
            return std::ranges::any_of(_children, [](const VExprSPtr& child) {
142
3.72k
                return child->can_evaluate_zonemap_filter();
143
3.72k
            });
144
10.0k
        case TExprOpcode::COMPOUND_OR:
145
17.0k
            return !_children.empty() && std::ranges::all_of(_children, [](const VExprSPtr& child) {
146
17.0k
                return child->can_evaluate_zonemap_filter();
147
17.0k
            });
148
4.63k
        case TExprOpcode::COMPOUND_NOT:
149
4.63k
            return false;
150
0
        default:
151
0
            return false;
152
17.8k
        }
153
17.8k
    }
154
155
3.09k
    ZoneMapFilterResult evaluate_zonemap_filter(const ZoneMapEvalContext& ctx) const override {
156
3.09k
        switch (_op) {
157
462
        case TExprOpcode::COMPOUND_AND: {
158
832
            for (const auto& child : _children) {
159
832
                if (!child->can_evaluate_zonemap_filter()) {
160
89
                    continue;
161
89
                }
162
743
                if (child->evaluate_zonemap_filter(ctx) == ZoneMapFilterResult::kNoMatch) {
163
168
                    return ZoneMapFilterResult::kNoMatch;
164
168
                }
165
743
            }
166
294
            return ZoneMapFilterResult::kMayMatch;
167
462
        }
168
2.64k
        case TExprOpcode::COMPOUND_OR: {
169
4.27k
            for (const auto& child : _children) {
170
4.27k
                DORIS_CHECK(child->can_evaluate_zonemap_filter());
171
4.27k
                if (child->evaluate_zonemap_filter(ctx) != ZoneMapFilterResult::kNoMatch) {
172
2.24k
                    return ZoneMapFilterResult::kMayMatch;
173
2.24k
                }
174
4.27k
            }
175
393
            return ZoneMapFilterResult::kNoMatch;
176
2.64k
        }
177
1
        case TExprOpcode::COMPOUND_NOT:
178
1
            return unsupported_zonemap_filter(ctx);
179
0
        default:
180
0
            return unsupported_zonemap_filter(ctx);
181
3.09k
        }
182
3.09k
    }
183
184
33
    bool can_evaluate_dictionary_filter() const override {
185
33
        switch (_op) {
186
30
        case TExprOpcode::COMPOUND_AND:
187
33
            return std::ranges::any_of(_children, [](const VExprSPtr& child) {
188
33
                return child->can_evaluate_dictionary_filter();
189
33
            });
190
3
        case TExprOpcode::COMPOUND_OR:
191
6
            return !_children.empty() && std::ranges::all_of(_children, [](const VExprSPtr& child) {
192
6
                return child->can_evaluate_dictionary_filter();
193
6
            });
194
0
        default:
195
0
            return false;
196
33
        }
197
33
    }
198
199
13
    bool is_safe_to_execute_on_selected_rows() const override {
200
        // Boolean composition introduces no data-dependent failure of its own. Reuse the generic
201
        // child walk so AND/OR remain eligible only when every nested expression is independently
202
        // safe; applying VectorizedFnCall's scalar-function allowlist to this structural node would
203
        // incorrectly disable selected-row execution for otherwise safe predicates.
204
13
        return VExpr::is_safe_to_execute_on_selected_rows();
205
13
    }
206
207
    ZoneMapFilterResult evaluate_dictionary_filter(
208
21
            const DictionaryEvalContext& ctx) const override {
209
21
        switch (_op) {
210
21
        case TExprOpcode::COMPOUND_AND:
211
29
            for (const auto& child : _children) {
212
29
                if (!child->can_evaluate_dictionary_filter()) {
213
8
                    continue;
214
8
                }
215
21
                if (child->evaluate_dictionary_filter(ctx) == ZoneMapFilterResult::kNoMatch) {
216
13
                    return ZoneMapFilterResult::kNoMatch;
217
13
                }
218
21
            }
219
8
            return ZoneMapFilterResult::kMayMatch;
220
0
        case TExprOpcode::COMPOUND_OR:
221
0
            for (const auto& child : _children) {
222
0
                DORIS_CHECK(child->can_evaluate_dictionary_filter());
223
0
                if (child->evaluate_dictionary_filter(ctx) != ZoneMapFilterResult::kNoMatch) {
224
0
                    return ZoneMapFilterResult::kMayMatch;
225
0
                }
226
0
            }
227
0
            return ZoneMapFilterResult::kNoMatch;
228
0
        default:
229
0
            return ZoneMapFilterResult::kUnsupported;
230
21
        }
231
21
    }
232
233
14
    bool can_evaluate_bloom_filter() const override {
234
14
        switch (_op) {
235
9
        case TExprOpcode::COMPOUND_AND:
236
15
            return std::ranges::any_of(_children, [](const VExprSPtr& child) {
237
15
                return child->can_evaluate_bloom_filter();
238
15
            });
239
5
        case TExprOpcode::COMPOUND_OR:
240
8
            return !_children.empty() && std::ranges::all_of(_children, [](const VExprSPtr& child) {
241
8
                return child->can_evaluate_bloom_filter();
242
8
            });
243
0
        default:
244
0
            return false;
245
14
        }
246
14
    }
247
248
0
    ZoneMapFilterResult evaluate_bloom_filter(const BloomFilterEvalContext& ctx) const override {
249
0
        switch (_op) {
250
0
        case TExprOpcode::COMPOUND_AND:
251
0
            for (const auto& child : _children) {
252
0
                if (!child->can_evaluate_bloom_filter()) {
253
0
                    continue;
254
0
                }
255
0
                if (child->evaluate_bloom_filter(ctx) == ZoneMapFilterResult::kNoMatch) {
256
0
                    return ZoneMapFilterResult::kNoMatch;
257
0
                }
258
0
            }
259
0
            return ZoneMapFilterResult::kMayMatch;
260
0
        case TExprOpcode::COMPOUND_OR:
261
0
            for (const auto& child : _children) {
262
0
                DORIS_CHECK(child->can_evaluate_bloom_filter());
263
0
                if (child->evaluate_bloom_filter(ctx) != ZoneMapFilterResult::kNoMatch) {
264
0
                    return ZoneMapFilterResult::kMayMatch;
265
0
                }
266
0
            }
267
0
            return ZoneMapFilterResult::kNoMatch;
268
0
        default:
269
0
            return ZoneMapFilterResult::kUnsupported;
270
0
        }
271
0
    }
272
273
5.52k
    Status evaluate_inverted_index(VExprContext* context, uint32_t segment_num_rows) override {
274
5.52k
        segment_v2::InvertedIndexResultBitmap res;
275
5.52k
        bool all_pass = true;
276
277
5.52k
        switch (_op) {
278
3.13k
        case TExprOpcode::COMPOUND_OR: {
279
6.07k
            for (const auto& child : _children) {
280
6.07k
                if (Status st = child->evaluate_inverted_index(context, segment_num_rows);
281
6.07k
                    !st.ok()) {
282
175
                    LOG(ERROR) << "expr:" << child->expr_name()
283
175
                               << " evaluate_inverted_index error:" << st.to_string();
284
175
                    if (!inverted_index_status_allows_row_fallback(st)) {
285
1
                        return st;
286
1
                    }
287
174
                    all_pass = false;
288
174
                    continue;
289
175
                }
290
5.89k
                auto inverted_index_context = context->get_index_context();
291
5.89k
                if (inverted_index_context->has_index_result_for_expr(child.get())) {
292
2.83k
                    const auto* index_result =
293
2.83k
                            inverted_index_context->get_index_result_for_expr(child.get());
294
2.83k
                    if (res.is_empty()) {
295
1.97k
                        res = *index_result;
296
1.97k
                    } else {
297
867
                        res |= *index_result;
298
867
                    }
299
2.84k
                    if (inverted_index_context->get_score_runtime() == nullptr) {
300
2.84k
                        if (res.get_data_bitmap()->cardinality() == segment_num_rows) {
301
341
                            break; // Early exit if result is full
302
341
                        }
303
2.84k
                    }
304
3.05k
                } else {
305
3.05k
                    all_pass = false;
306
3.05k
                }
307
5.89k
            }
308
3.13k
            break;
309
3.13k
        }
310
3.13k
        case TExprOpcode::COMPOUND_AND: {
311
1.62k
            for (const auto& child : _children) {
312
1.62k
                if (Status st = child->evaluate_inverted_index(context, segment_num_rows);
313
1.62k
                    !st.ok()) {
314
28
                    LOG(ERROR) << "expr:" << child->expr_name()
315
28
                               << " evaluate_inverted_index error:" << st.to_string();
316
28
                    if (!inverted_index_status_allows_row_fallback(st)) {
317
2
                        return st;
318
2
                    }
319
26
                    all_pass = false;
320
26
                    continue;
321
28
                }
322
1.60k
                if (context->get_index_context()->has_index_result_for_expr(child.get())) {
323
245
                    const auto* index_result =
324
245
                            context->get_index_context()->get_index_result_for_expr(child.get());
325
245
                    if (res.is_empty()) {
326
184
                        res = *index_result;
327
184
                    } else {
328
61
                        res &= *index_result;
329
61
                    }
330
331
245
                    if (res.get_data_bitmap()->isEmpty()) {
332
100
                        break; // Early exit if result is empty
333
100
                    }
334
1.35k
                } else {
335
1.35k
                    all_pass = false;
336
1.35k
                }
337
1.60k
            }
338
860
            break;
339
862
        }
340
1.51k
        case TExprOpcode::COMPOUND_NOT: {
341
1.51k
            const auto& child = _children[0];
342
1.51k
            Status st = child->evaluate_inverted_index(context, segment_num_rows);
343
1.51k
            if (!st.ok()) {
344
40
                LOG(ERROR) << "expr:" << child->expr_name()
345
40
                           << " evaluate_inverted_index error:" << st.to_string();
346
40
                return st;
347
40
            }
348
349
1.47k
            if (context->get_index_context()->has_index_result_for_expr(child.get())) {
350
717
                const auto* index_result =
351
717
                        context->get_index_context()->get_index_result_for_expr(child.get());
352
717
                roaring::Roaring full_result;
353
717
                full_result.addRange(0, segment_num_rows);
354
717
                res = index_result->op_not(&full_result);
355
755
            } else {
356
755
                all_pass = false;
357
755
            }
358
1.47k
            break;
359
1.51k
        }
360
0
        default:
361
0
            return Status::NotSupported(
362
0
                    "Compound operator must be AND, OR, or NOT to execute with inverted index.");
363
5.52k
        }
364
365
5.50k
        if (all_pass && !res.is_empty()) {
366
1.97k
            context->get_index_context()->set_index_result_for_expr(this, res);
367
1.97k
        }
368
5.50k
        return Status::OK();
369
5.52k
    }
370
371
    Status execute_column_impl(VExprContext* context, const Block* block, const Selector* selector,
372
28.5k
                               size_t count, ColumnPtr& result_column) const override {
373
28.5k
        if (fast_execute(context, selector, count, result_column)) {
374
99
            return Status::OK();
375
99
        }
376
28.4k
        if (get_num_children() == 1 || _has_const_child()) {
377
3.56k
            return VectorizedFnCall::execute_column_impl(context, block, selector, count,
378
3.56k
                                                         result_column);
379
3.56k
        }
380
381
24.8k
        ColumnPtr lhs_column;
382
24.8k
        RETURN_IF_ERROR(_children[0]->execute_column(context, block, selector, count, lhs_column));
383
24.8k
        lhs_column = lhs_column->convert_to_full_column_if_const();
384
24.8k
        size_t size = lhs_column->size();
385
386
24.8k
        bool lhs_is_nullable = lhs_column->is_nullable();
387
24.8k
        auto [lhs_data_column, lhs_null_map] =
388
24.8k
                _get_raw_data_and_null_map(lhs_column, lhs_is_nullable);
389
24.8k
        size_t filted = simd::count_zero_num((int8_t*)lhs_data_column, size);
390
24.8k
        bool lhs_all_true = (filted == 0);
391
24.8k
        bool lhs_all_false = (filted == size);
392
393
24.8k
        bool lhs_all_is_not_null = false;
394
24.8k
        if (lhs_is_nullable) {
395
14.0k
            filted = simd::count_zero_num((int8_t*)lhs_null_map, size);
396
14.0k
            lhs_all_is_not_null = (filted == size);
397
14.0k
        }
398
399
24.8k
        ColumnPtr rhs_column = nullptr;
400
24.8k
        const uint8_t* __restrict rhs_data_column = nullptr;
401
24.8k
        const uint8_t* __restrict rhs_null_map = nullptr;
402
24.8k
        bool rhs_is_nullable = false;
403
24.8k
        bool rhs_all_true = false;
404
24.8k
        bool rhs_all_false = false;
405
24.8k
        bool rhs_all_is_not_null = false;
406
24.8k
        bool result_is_nullable = _data_type->is_nullable();
407
408
24.8k
        auto get_rhs_colum = [&]() {
409
18.8k
            if (!rhs_column) {
410
18.8k
                RETURN_IF_ERROR(
411
18.8k
                        _children[1]->execute_column(context, block, selector, count, rhs_column));
412
18.8k
                rhs_column = rhs_column->convert_to_full_column_if_const();
413
18.8k
                rhs_is_nullable = rhs_column->is_nullable();
414
18.8k
                auto rhs_nullable_column = _get_raw_data_and_null_map(rhs_column, rhs_is_nullable);
415
18.8k
                rhs_data_column = rhs_nullable_column.first;
416
18.8k
                rhs_null_map = rhs_nullable_column.second;
417
18.8k
                size_t filted = simd::count_zero_num((int8_t*)rhs_data_column, size);
418
18.8k
                rhs_all_true = (filted == 0);
419
18.8k
                rhs_all_false = (filted == size);
420
18.8k
                if (rhs_is_nullable) {
421
13.6k
                    filted = simd::count_zero_num((int8_t*)rhs_null_map, size);
422
13.6k
                    rhs_all_is_not_null = (filted == size);
423
13.6k
                }
424
18.8k
            }
425
18.8k
            return Status::OK();
426
18.8k
        };
427
428
24.8k
        auto return_result_column_id = [&](ColumnPtr& arg_column) {
429
19.2k
            result_column = std::move(*arg_column).mutate();
430
19.2k
            if (result_is_nullable && !result_column->is_nullable()) {
431
2.73k
                result_column = make_nullable(result_column);
432
2.73k
            }
433
19.2k
        };
434
435
24.8k
        auto create_null_map_column = [&](ColumnPtr& null_map_column,
436
24.8k
                                          const uint8_t* __restrict null_map_data) {
437
9.58k
            if (null_map_data == nullptr) {
438
805
                null_map_column = ColumnUInt8::create(size, 0);
439
805
                null_map_data =
440
805
                        assert_cast<const ColumnUInt8*>(null_map_column.get())->get_data().data();
441
805
            }
442
9.58k
            return null_map_data;
443
9.58k
        };
444
445
24.8k
        auto vector_vector = [&]<bool is_and_op>() {
446
902
            MutableColumnPtr mutable_result_column;
447
902
            uint8_t* __restrict result_data_column = nullptr;
448
902
            const uint8_t* __restrict other_data_column = rhs_data_column;
449
902
            if (lhs_column->use_count() == 1) {
450
854
                mutable_result_column = IColumn::mutate(std::move(lhs_column));
451
854
                result_data_column =
452
854
                        assert_cast<ColumnUInt8*>(mutable_result_column.get())->get_data().data();
453
854
            } else if (rhs_column->use_count() == 1) {
454
2
                mutable_result_column = IColumn::mutate(std::move(rhs_column));
455
2
                result_data_column =
456
2
                        assert_cast<ColumnUInt8*>(mutable_result_column.get())->get_data().data();
457
2
                other_data_column = lhs_data_column;
458
46
            } else {
459
46
                mutable_result_column = lhs_column->clone_resized(size);
460
46
                result_data_column =
461
46
                        assert_cast<ColumnUInt8*>(mutable_result_column.get())->get_data().data();
462
46
            }
463
464
902
            do_not_null_pred<is_and_op>(result_data_column, other_data_column, size);
465
902
            result_column = std::move(mutable_result_column);
466
902
        };
_ZZNK5doris13VCompoundPred19execute_column_implEPNS_12VExprContextEPKNS_5BlockEPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEmRNS_3COWINS_7IColumnEE13immutable_ptrISE_EEENKUlTnbvE_clILb1EEEDav
Line
Count
Source
445
614
        auto vector_vector = [&]<bool is_and_op>() {
446
614
            MutableColumnPtr mutable_result_column;
447
614
            uint8_t* __restrict result_data_column = nullptr;
448
614
            const uint8_t* __restrict other_data_column = rhs_data_column;
449
614
            if (lhs_column->use_count() == 1) {
450
614
                mutable_result_column = IColumn::mutate(std::move(lhs_column));
451
614
                result_data_column =
452
614
                        assert_cast<ColumnUInt8*>(mutable_result_column.get())->get_data().data();
453
614
            } else if (rhs_column->use_count() == 1) {
454
0
                mutable_result_column = IColumn::mutate(std::move(rhs_column));
455
0
                result_data_column =
456
0
                        assert_cast<ColumnUInt8*>(mutable_result_column.get())->get_data().data();
457
0
                other_data_column = lhs_data_column;
458
0
            } else {
459
0
                mutable_result_column = lhs_column->clone_resized(size);
460
0
                result_data_column =
461
0
                        assert_cast<ColumnUInt8*>(mutable_result_column.get())->get_data().data();
462
0
            }
463
464
614
            do_not_null_pred<is_and_op>(result_data_column, other_data_column, size);
465
614
            result_column = std::move(mutable_result_column);
466
614
        };
_ZZNK5doris13VCompoundPred19execute_column_implEPNS_12VExprContextEPKNS_5BlockEPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEmRNS_3COWINS_7IColumnEE13immutable_ptrISE_EEENKUlTnbvE_clILb0EEEDav
Line
Count
Source
445
288
        auto vector_vector = [&]<bool is_and_op>() {
446
288
            MutableColumnPtr mutable_result_column;
447
288
            uint8_t* __restrict result_data_column = nullptr;
448
288
            const uint8_t* __restrict other_data_column = rhs_data_column;
449
288
            if (lhs_column->use_count() == 1) {
450
240
                mutable_result_column = IColumn::mutate(std::move(lhs_column));
451
240
                result_data_column =
452
240
                        assert_cast<ColumnUInt8*>(mutable_result_column.get())->get_data().data();
453
240
            } else if (rhs_column->use_count() == 1) {
454
2
                mutable_result_column = IColumn::mutate(std::move(rhs_column));
455
2
                result_data_column =
456
2
                        assert_cast<ColumnUInt8*>(mutable_result_column.get())->get_data().data();
457
2
                other_data_column = lhs_data_column;
458
46
            } else {
459
46
                mutable_result_column = lhs_column->clone_resized(size);
460
46
                result_data_column =
461
46
                        assert_cast<ColumnUInt8*>(mutable_result_column.get())->get_data().data();
462
46
            }
463
464
288
            do_not_null_pred<is_and_op>(result_data_column, other_data_column, size);
465
288
            result_column = std::move(mutable_result_column);
466
288
        };
467
24.8k
        auto vector_vector_null = [&]<bool is_and_op>() {
468
4.79k
            auto col_res = ColumnUInt8::create(size);
469
4.79k
            auto col_nulls = ColumnUInt8::create(size);
470
471
4.79k
            auto* __restrict res_datas = col_res->get_data().data();
472
4.79k
            auto* __restrict res_nulls = col_nulls->get_data().data();
473
4.79k
            ColumnPtr temp_null_map = nullptr;
474
            // maybe both children are nullable / or one of children is nullable
475
4.79k
            auto* __restrict lhs_null_map_tmp = create_null_map_column(temp_null_map, lhs_null_map);
476
4.79k
            auto* __restrict rhs_null_map_tmp = create_null_map_column(temp_null_map, rhs_null_map);
477
4.79k
            auto* __restrict lhs_data_column_tmp = lhs_data_column;
478
4.79k
            auto* __restrict rhs_data_column_tmp = rhs_data_column;
479
480
4.79k
            do_null_pred<is_and_op>(lhs_data_column_tmp, lhs_null_map_tmp, rhs_data_column_tmp,
481
4.79k
                                    rhs_null_map_tmp, res_datas, res_nulls, size);
482
483
4.79k
            result_column = ColumnNullable::create(std::move(col_res), std::move(col_nulls));
484
4.79k
        };
_ZZNK5doris13VCompoundPred19execute_column_implEPNS_12VExprContextEPKNS_5BlockEPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEmRNS_3COWINS_7IColumnEE13immutable_ptrISE_EEENKUlTnbvE0_clILb1EEEDav
Line
Count
Source
467
807
        auto vector_vector_null = [&]<bool is_and_op>() {
468
807
            auto col_res = ColumnUInt8::create(size);
469
807
            auto col_nulls = ColumnUInt8::create(size);
470
471
807
            auto* __restrict res_datas = col_res->get_data().data();
472
807
            auto* __restrict res_nulls = col_nulls->get_data().data();
473
807
            ColumnPtr temp_null_map = nullptr;
474
            // maybe both children are nullable / or one of children is nullable
475
807
            auto* __restrict lhs_null_map_tmp = create_null_map_column(temp_null_map, lhs_null_map);
476
807
            auto* __restrict rhs_null_map_tmp = create_null_map_column(temp_null_map, rhs_null_map);
477
807
            auto* __restrict lhs_data_column_tmp = lhs_data_column;
478
807
            auto* __restrict rhs_data_column_tmp = rhs_data_column;
479
480
807
            do_null_pred<is_and_op>(lhs_data_column_tmp, lhs_null_map_tmp, rhs_data_column_tmp,
481
807
                                    rhs_null_map_tmp, res_datas, res_nulls, size);
482
483
807
            result_column = ColumnNullable::create(std::move(col_res), std::move(col_nulls));
484
807
        };
_ZZNK5doris13VCompoundPred19execute_column_implEPNS_12VExprContextEPKNS_5BlockEPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEmRNS_3COWINS_7IColumnEE13immutable_ptrISE_EEENKUlTnbvE0_clILb0EEEDav
Line
Count
Source
467
3.98k
        auto vector_vector_null = [&]<bool is_and_op>() {
468
3.98k
            auto col_res = ColumnUInt8::create(size);
469
3.98k
            auto col_nulls = ColumnUInt8::create(size);
470
471
3.98k
            auto* __restrict res_datas = col_res->get_data().data();
472
3.98k
            auto* __restrict res_nulls = col_nulls->get_data().data();
473
3.98k
            ColumnPtr temp_null_map = nullptr;
474
            // maybe both children are nullable / or one of children is nullable
475
3.98k
            auto* __restrict lhs_null_map_tmp = create_null_map_column(temp_null_map, lhs_null_map);
476
3.98k
            auto* __restrict rhs_null_map_tmp = create_null_map_column(temp_null_map, rhs_null_map);
477
3.98k
            auto* __restrict lhs_data_column_tmp = lhs_data_column;
478
3.98k
            auto* __restrict rhs_data_column_tmp = rhs_data_column;
479
480
3.98k
            do_null_pred<is_and_op>(lhs_data_column_tmp, lhs_null_map_tmp, rhs_data_column_tmp,
481
3.98k
                                    rhs_null_map_tmp, res_datas, res_nulls, size);
482
483
3.98k
            result_column = ColumnNullable::create(std::move(col_res), std::move(col_nulls));
484
3.98k
        };
485
486
        // false and NULL ----> 0
487
        // true  and NULL ----> NULL
488
24.8k
        if (_op == TExprOpcode::COMPOUND_AND) {
489
            //1. not null column: all data is false
490
            //2. nullable column: null map all is not null
491
5.41k
            if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
492
                // false and any = false, return lhs
493
2.04k
                return_result_column_id(lhs_column);
494
3.37k
            } else {
495
3.37k
                RETURN_IF_ERROR(get_rhs_colum());
496
497
3.37k
                if ((lhs_all_true && !lhs_is_nullable) ||    //not null column
498
3.37k
                    (lhs_all_true && lhs_all_is_not_null)) { //nullable column
499
                                                             // true and any = any, return rhs
500
501
1.42k
                    return_result_column_id(rhs_column);
502
1.94k
                } else if ((rhs_all_false && !rhs_is_nullable) ||
503
1.94k
                           (rhs_all_false && rhs_all_is_not_null)) {
504
                    // any and false = false, return rhs
505
221
                    return_result_column_id(rhs_column);
506
1.72k
                } else if ((rhs_all_true && !rhs_is_nullable) ||
507
1.72k
                           (rhs_all_true && rhs_all_is_not_null)) {
508
                    // any and true = any, return lhs
509
308
                    return_result_column_id(lhs_column);
510
1.41k
                } else {
511
1.41k
                    if (!result_is_nullable) {
512
614
                        vector_vector.template operator()<true>();
513
804
                    } else {
514
804
                        vector_vector_null.template operator()<true>();
515
804
                    }
516
1.41k
                }
517
3.37k
            }
518
19.4k
        } else if (_op == TExprOpcode::COMPOUND_OR) {
519
            // true  or NULL ----> 1
520
            // false or NULL ----> NULL
521
19.4k
            if ((lhs_all_true && !lhs_is_nullable) || (lhs_all_true && lhs_all_is_not_null)) {
522
                // true or any = true, return lhs
523
3.95k
                return_result_column_id(lhs_column);
524
15.5k
            } else {
525
15.5k
                RETURN_IF_ERROR(get_rhs_colum());
526
15.5k
                if ((lhs_all_false && !lhs_is_nullable) || (lhs_all_false && lhs_all_is_not_null)) {
527
                    // false or any = any, return rhs
528
9.86k
                    return_result_column_id(rhs_column);
529
9.86k
                } else if ((rhs_all_true && !rhs_is_nullable) ||
530
5.65k
                           (rhs_all_true && rhs_all_is_not_null)) {
531
                    // any or true = true, return rhs
532
761
                    return_result_column_id(rhs_column);
533
4.89k
                } else if ((rhs_all_false && !rhs_is_nullable) ||
534
4.89k
                           (rhs_all_false && rhs_all_is_not_null)) {
535
                    // any or false = any, return lhs
536
659
                    return_result_column_id(lhs_column);
537
4.23k
                } else {
538
4.23k
                    if (!result_is_nullable) {
539
288
                        vector_vector.template operator()<false>();
540
3.94k
                    } else {
541
3.94k
                        vector_vector_null.template operator()<false>();
542
3.94k
                    }
543
4.23k
                }
544
15.5k
            }
545
18.4E
        } else {
546
18.4E
            return Status::InternalError("Compound operator must be AND or OR.");
547
18.4E
        }
548
549
24.8k
        DCHECK_EQ(result_column->size(), count);
550
24.8k
        return Status::OK();
551
24.8k
    }
552
553
958
    double execute_cost() const override {
554
958
        double cost = 0.3;
555
1.51k
        for (const auto& child : _children) {
556
1.51k
            cost += child->execute_cost();
557
1.51k
        }
558
958
        return cost;
559
958
    }
560
561
private:
562
    template <typename ExecuteChild>
563
    Status _execute_raw_compound(size_t num_values, uint8_t* matches,
564
10
                                 ExecuteChild&& execute_child) const {
565
10
        if (_op == TExprOpcode::COMPOUND_AND) {
566
2
            for (const auto& child : _children) {
567
2
                RETURN_IF_ERROR(execute_child(child, matches));
568
2
            }
569
1
            return Status::OK();
570
1
        }
571
572
        // Each execution context owns its expression tree. Retaining masks on the OR node avoids
573
        // N+1 row-sized allocations for every decoder fragment, while nested OR nodes keep
574
        // independent buffers and therefore cannot overwrite their parent's in-flight state.
575
9
        _raw_combined_scratch.resize(num_values);
576
9
        std::ranges::fill(_raw_combined_scratch, 0);
577
18
        for (const auto& child : _children) {
578
            // resize_fill() initializes only newly appended bytes; explicitly reset a reused mask
579
            // so matches from an earlier page fragment cannot leak into this OR evaluation.
580
18
            _raw_child_scratch.resize(num_values);
581
18
            std::ranges::fill(_raw_child_scratch, 1);
582
18
            RETURN_IF_ERROR(execute_child(child, _raw_child_scratch.data()));
583
154
            for (size_t row = 0; row < num_values; ++row) {
584
136
                _raw_combined_scratch[row] |= _raw_child_scratch[row];
585
136
            }
586
18
        }
587
        // Raw kernels receive an existing selection mask, so composition must preserve rows that
588
        // an earlier conjunct already rejected instead of replacing the caller's mask.
589
77
        for (size_t row = 0; row < num_values; ++row) {
590
68
            matches[row] &= _raw_combined_scratch[row];
591
68
        }
592
9
        constexpr size_t MAX_RETAINED_RAW_MASK_BYTES = 1UL << 20;
593
9
        if (_raw_combined_scratch.capacity() > MAX_RETAINED_RAW_MASK_BYTES) {
594
0
            IColumn::Filter().swap(_raw_combined_scratch);
595
0
        }
596
9
        if (_raw_child_scratch.capacity() > MAX_RETAINED_RAW_MASK_BYTES) {
597
0
            IColumn::Filter().swap(_raw_child_scratch);
598
0
        }
599
9
        return Status::OK();
600
9
    }
_ZNK5doris13VCompoundPred21_execute_raw_compoundIZNKS0_27execute_on_raw_fixed_valuesEPKhmmRKSt10shared_ptrIKNS_9IDataTypeEEiPhEUlRKS4_INS_5VExprEESA_E_EENS_6StatusEmSA_OT_
Line
Count
Source
564
2
                                 ExecuteChild&& execute_child) const {
565
2
        if (_op == TExprOpcode::COMPOUND_AND) {
566
2
            for (const auto& child : _children) {
567
2
                RETURN_IF_ERROR(execute_child(child, matches));
568
2
            }
569
1
            return Status::OK();
570
1
        }
571
572
        // Each execution context owns its expression tree. Retaining masks on the OR node avoids
573
        // N+1 row-sized allocations for every decoder fragment, while nested OR nodes keep
574
        // independent buffers and therefore cannot overwrite their parent's in-flight state.
575
1
        _raw_combined_scratch.resize(num_values);
576
1
        std::ranges::fill(_raw_combined_scratch, 0);
577
2
        for (const auto& child : _children) {
578
            // resize_fill() initializes only newly appended bytes; explicitly reset a reused mask
579
            // so matches from an earlier page fragment cannot leak into this OR evaluation.
580
2
            _raw_child_scratch.resize(num_values);
581
2
            std::ranges::fill(_raw_child_scratch, 1);
582
2
            RETURN_IF_ERROR(execute_child(child, _raw_child_scratch.data()));
583
10
            for (size_t row = 0; row < num_values; ++row) {
584
8
                _raw_combined_scratch[row] |= _raw_child_scratch[row];
585
8
            }
586
2
        }
587
        // Raw kernels receive an existing selection mask, so composition must preserve rows that
588
        // an earlier conjunct already rejected instead of replacing the caller's mask.
589
5
        for (size_t row = 0; row < num_values; ++row) {
590
4
            matches[row] &= _raw_combined_scratch[row];
591
4
        }
592
1
        constexpr size_t MAX_RETAINED_RAW_MASK_BYTES = 1UL << 20;
593
1
        if (_raw_combined_scratch.capacity() > MAX_RETAINED_RAW_MASK_BYTES) {
594
0
            IColumn::Filter().swap(_raw_combined_scratch);
595
0
        }
596
1
        if (_raw_child_scratch.capacity() > MAX_RETAINED_RAW_MASK_BYTES) {
597
0
            IColumn::Filter().swap(_raw_child_scratch);
598
0
        }
599
1
        return Status::OK();
600
1
    }
_ZNK5doris13VCompoundPred21_execute_raw_compoundIZNKS0_28execute_on_raw_binary_valuesEPKNS_9StringRefEmRKSt10shared_ptrIKNS_9IDataTypeEEiPhEUlRKS5_INS_5VExprEESB_E_EENS_6StatusEmSB_OT_
Line
Count
Source
564
8
                                 ExecuteChild&& execute_child) const {
565
8
        if (_op == TExprOpcode::COMPOUND_AND) {
566
0
            for (const auto& child : _children) {
567
0
                RETURN_IF_ERROR(execute_child(child, matches));
568
0
            }
569
0
            return Status::OK();
570
0
        }
571
572
        // Each execution context owns its expression tree. Retaining masks on the OR node avoids
573
        // N+1 row-sized allocations for every decoder fragment, while nested OR nodes keep
574
        // independent buffers and therefore cannot overwrite their parent's in-flight state.
575
8
        _raw_combined_scratch.resize(num_values);
576
8
        std::ranges::fill(_raw_combined_scratch, 0);
577
16
        for (const auto& child : _children) {
578
            // resize_fill() initializes only newly appended bytes; explicitly reset a reused mask
579
            // so matches from an earlier page fragment cannot leak into this OR evaluation.
580
16
            _raw_child_scratch.resize(num_values);
581
16
            std::ranges::fill(_raw_child_scratch, 1);
582
16
            RETURN_IF_ERROR(execute_child(child, _raw_child_scratch.data()));
583
144
            for (size_t row = 0; row < num_values; ++row) {
584
128
                _raw_combined_scratch[row] |= _raw_child_scratch[row];
585
128
            }
586
16
        }
587
        // Raw kernels receive an existing selection mask, so composition must preserve rows that
588
        // an earlier conjunct already rejected instead of replacing the caller's mask.
589
72
        for (size_t row = 0; row < num_values; ++row) {
590
64
            matches[row] &= _raw_combined_scratch[row];
591
64
        }
592
8
        constexpr size_t MAX_RETAINED_RAW_MASK_BYTES = 1UL << 20;
593
8
        if (_raw_combined_scratch.capacity() > MAX_RETAINED_RAW_MASK_BYTES) {
594
0
            IColumn::Filter().swap(_raw_combined_scratch);
595
0
        }
596
8
        if (_raw_child_scratch.capacity() > MAX_RETAINED_RAW_MASK_BYTES) {
597
0
            IColumn::Filter().swap(_raw_child_scratch);
598
0
        }
599
8
        return Status::OK();
600
8
    }
601
602
    mutable IColumn::Filter _raw_combined_scratch;
603
    mutable IColumn::Filter _raw_child_scratch;
604
605
8.09k
    static inline constexpr uint8_t apply_and_null(UInt8 a, UInt8 l_null, UInt8 b, UInt8 r_null) {
606
        // (<> && false) is false, (true && NULL) is NULL
607
8.09k
        return (l_null & r_null) | (r_null & (l_null ^ a)) | (l_null & (r_null ^ b));
608
8.09k
    }
609
867k
    static inline constexpr uint8_t apply_or_null(UInt8 a, UInt8 l_null, UInt8 b, UInt8 r_null) {
610
        // (<> || true) is true, (false || NULL) is NULL
611
867k
        return (l_null & r_null) | (r_null & (r_null ^ a)) | (l_null & (l_null ^ b));
612
867k
    }
613
614
    template <bool is_and>
615
    void static do_not_null_pred(uint8_t* __restrict lhs, const uint8_t* __restrict rhs,
616
901
                                 size_t size) {
617
#ifdef NDEBUG
618
#if defined(__clang__)
619
#pragma clang loop vectorize(enable)
620
#elif defined(__GNUC__) && (__GNUC__ >= 5)
621
#pragma GCC ivdep
622
#endif
623
#endif
624
17.1k
        for (size_t i = 0; i < size; ++i) {
625
16.2k
            if constexpr (is_and) {
626
11.1k
                lhs[i] &= rhs[i];
627
11.1k
            } else {
628
                // Logical OR must produce a canonical Boolean instead of preserving input bits.
629
5.18k
                lhs[i] = (lhs[i] | rhs[i]) != 0;
630
5.18k
            }
631
16.2k
        }
632
901
    }
_ZN5doris13VCompoundPred16do_not_null_predILb1EEEvPhPKhm
Line
Count
Source
616
613
                                 size_t size) {
617
#ifdef NDEBUG
618
#if defined(__clang__)
619
#pragma clang loop vectorize(enable)
620
#elif defined(__GNUC__) && (__GNUC__ >= 5)
621
#pragma GCC ivdep
622
#endif
623
#endif
624
11.7k
        for (size_t i = 0; i < size; ++i) {
625
11.1k
            if constexpr (is_and) {
626
11.1k
                lhs[i] &= rhs[i];
627
            } else {
628
                // Logical OR must produce a canonical Boolean instead of preserving input bits.
629
                lhs[i] = (lhs[i] | rhs[i]) != 0;
630
            }
631
11.1k
        }
632
613
    }
_ZN5doris13VCompoundPred16do_not_null_predILb0EEEvPhPKhm
Line
Count
Source
616
288
                                 size_t size) {
617
#ifdef NDEBUG
618
#if defined(__clang__)
619
#pragma clang loop vectorize(enable)
620
#elif defined(__GNUC__) && (__GNUC__ >= 5)
621
#pragma GCC ivdep
622
#endif
623
#endif
624
5.46k
        for (size_t i = 0; i < size; ++i) {
625
            if constexpr (is_and) {
626
                lhs[i] &= rhs[i];
627
5.18k
            } else {
628
                // Logical OR must produce a canonical Boolean instead of preserving input bits.
629
5.18k
                lhs[i] = (lhs[i] | rhs[i]) != 0;
630
5.18k
            }
631
5.18k
        }
632
288
    }
633
634
    template <bool is_and>
635
    void static do_null_pred(const uint8_t* __restrict lhs_data, const uint8_t* __restrict lhs_null,
636
                             const uint8_t* __restrict rhs_data, const uint8_t* __restrict rhs_null,
637
                             uint8_t* __restrict res_data, uint8_t* __restrict res_null,
638
4.79k
                             size_t size) {
639
#ifdef NDEBUG
640
#if defined(__clang__)
641
#pragma clang loop vectorize(enable)
642
#elif defined(__GNUC__) && (__GNUC__ >= 5)
643
#pragma GCC ivdep
644
#endif
645
#endif
646
879k
        for (size_t i = 0; i < size; ++i) {
647
874k
            if constexpr (is_and) {
648
8.09k
                res_null[i] = apply_and_null(lhs_data[i], lhs_null[i], rhs_data[i], rhs_null[i]);
649
8.09k
                res_data[i] = lhs_data[i] & rhs_data[i];
650
866k
            } else {
651
866k
                res_null[i] = apply_or_null(lhs_data[i], lhs_null[i], rhs_data[i], rhs_null[i]);
652
                // A NULL row may carry an arbitrary nested byte. If the result remains NULL the
653
                // byte is ignored; otherwise normalization prevents it from becoming visible.
654
866k
                res_data[i] = (lhs_data[i] | rhs_data[i]) != 0;
655
866k
            }
656
874k
        }
657
4.79k
    }
_ZN5doris13VCompoundPred12do_null_predILb1EEEvPKhS3_S3_S3_PhS4_m
Line
Count
Source
638
807
                             size_t size) {
639
#ifdef NDEBUG
640
#if defined(__clang__)
641
#pragma clang loop vectorize(enable)
642
#elif defined(__GNUC__) && (__GNUC__ >= 5)
643
#pragma GCC ivdep
644
#endif
645
#endif
646
8.90k
        for (size_t i = 0; i < size; ++i) {
647
8.09k
            if constexpr (is_and) {
648
8.09k
                res_null[i] = apply_and_null(lhs_data[i], lhs_null[i], rhs_data[i], rhs_null[i]);
649
8.09k
                res_data[i] = lhs_data[i] & rhs_data[i];
650
            } else {
651
                res_null[i] = apply_or_null(lhs_data[i], lhs_null[i], rhs_data[i], rhs_null[i]);
652
                // A NULL row may carry an arbitrary nested byte. If the result remains NULL the
653
                // byte is ignored; otherwise normalization prevents it from becoming visible.
654
                res_data[i] = (lhs_data[i] | rhs_data[i]) != 0;
655
            }
656
8.09k
        }
657
807
    }
_ZN5doris13VCompoundPred12do_null_predILb0EEEvPKhS3_S3_S3_PhS4_m
Line
Count
Source
638
3.98k
                             size_t size) {
639
#ifdef NDEBUG
640
#if defined(__clang__)
641
#pragma clang loop vectorize(enable)
642
#elif defined(__GNUC__) && (__GNUC__ >= 5)
643
#pragma GCC ivdep
644
#endif
645
#endif
646
870k
        for (size_t i = 0; i < size; ++i) {
647
            if constexpr (is_and) {
648
                res_null[i] = apply_and_null(lhs_data[i], lhs_null[i], rhs_data[i], rhs_null[i]);
649
                res_data[i] = lhs_data[i] & rhs_data[i];
650
866k
            } else {
651
866k
                res_null[i] = apply_or_null(lhs_data[i], lhs_null[i], rhs_data[i], rhs_null[i]);
652
                // A NULL row may carry an arbitrary nested byte. If the result remains NULL the
653
                // byte is ignored; otherwise normalization prevents it from becoming visible.
654
866k
                res_data[i] = (lhs_data[i] | rhs_data[i]) != 0;
655
866k
            }
656
866k
        }
657
3.98k
    }
658
659
25.1k
    bool _has_const_child() const {
660
25.1k
        return std::ranges::any_of(_children,
661
50.1k
                                   [](const VExprSPtr& arg) -> bool { return arg->is_constant(); });
662
25.1k
    }
663
664
    std::pair<const uint8_t*, const uint8_t*> _get_raw_data_and_null_map(
665
43.8k
            const ColumnPtr& column, bool has_nullable_column) const {
666
43.8k
        if (has_nullable_column) {
667
27.7k
            const auto* nullable_column = assert_cast<const ColumnNullable*>(column.get());
668
27.7k
            auto* data_column =
669
27.7k
                    assert_cast<const ColumnUInt8*>(nullable_column->get_nested_column_ptr().get())
670
27.7k
                            ->get_data()
671
27.7k
                            .data();
672
27.7k
            auto* null_map = nullable_column->get_null_map_column_ptr()->get_data().data();
673
27.7k
            return std::make_pair(data_column, null_map);
674
27.7k
        } else {
675
16.0k
            auto* data_column = assert_cast<const ColumnUInt8*>(column.get())->get_data().data();
676
16.0k
            return std::make_pair(data_column, nullptr);
677
16.0k
        }
678
43.8k
    }
679
680
    TExprOpcode::type _op;
681
};
682
683
} // namespace doris