Coverage Report

Created: 2024-11-22 12:06

/root/doris/be/src/exprs/minmax_predicate.h
Line
Count
Source (jump to first uncovered line)
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#pragma once
19
20
#include <type_traits>
21
22
#include "common/object_pool.h"
23
#include "exprs/runtime_filter.h"
24
#include "runtime/type_limit.h"
25
#include "vec/columns/column.h"
26
#include "vec/columns/column_nullable.h"
27
#include "vec/columns/column_string.h"
28
#include "vec/common/assert_cast.h"
29
30
namespace doris {
31
// only used in Runtime Filter
32
class MinMaxFuncBase : public RuntimeFilterFuncBase {
33
public:
34
    virtual void insert_fixed_len(const vectorized::ColumnPtr& column, size_t start) = 0;
35
    virtual void* get_max() = 0;
36
    virtual void* get_min() = 0;
37
    // assign minmax data
38
    virtual Status assign(void* min_data, void* max_data) = 0;
39
    // merge from other minmax_func
40
    virtual Status merge(MinMaxFuncBase* minmax_func) = 0;
41
0
    virtual ~MinMaxFuncBase() = default;
42
43
0
    bool contain_null() const { return _null_aware && _contain_null; }
44
45
0
    void set_contain_null() { _contain_null = true; }
46
47
protected:
48
    bool _contain_null = false;
49
};
50
51
template <class T, bool NeedMax = true, bool NeedMin = true>
52
class MinMaxNumFunc : public MinMaxFuncBase {
53
public:
54
0
    MinMaxNumFunc() = default;
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIbLb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_14DecimalV2ValueELb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIaLb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIsLb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIiLb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIlLb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncInLb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIfLb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIdLb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_16VecDateTimeValueELb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_15DateV2ValueTypeEEELb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIiEELb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIlEELb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized12Decimal128V3ELb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIN4wide7integerILm256EiEEEELb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIjLb1ELb1EEC2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIoLb1ELb1EEC2Ev
55
0
    ~MinMaxNumFunc() override = default;
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIbLb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_14DecimalV2ValueELb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIaLb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIsLb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIiLb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIlLb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncInLb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIfLb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIdLb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_16VecDateTimeValueELb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_15DateV2ValueTypeEEELb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIiEELb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIlEELb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized12Decimal128V3ELb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIN4wide7integerILm256EiEEEELb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIjLb1ELb1EED2Ev
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIoLb1ELb1EED2Ev
56
57
0
    void insert_fixed_len(const vectorized::ColumnPtr& column, size_t start) override {
58
0
        if (column->is_nullable()) {
59
0
            const auto* nullable = assert_cast<const vectorized::ColumnNullable*>(column.get());
60
0
            const auto& col = nullable->get_nested_column_ptr();
61
0
            const auto& nullmap = nullable->get_null_map_data();
62
0
            if (nullable->has_null()) {
63
0
                update_batch(col, nullmap, start);
64
0
                _contain_null = true;
65
0
            } else {
66
0
                update_batch(col, start);
67
0
            }
68
0
        } else {
69
0
            update_batch(column, start);
70
0
        }
71
0
    }
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIbLb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_14DecimalV2ValueELb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS5_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIaLb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIsLb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIiLb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIlLb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncInLb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIfLb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIdLb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_16VecDateTimeValueELb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS5_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_15DateV2ValueTypeEEELb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS7_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS7_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS5_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIiEELb1ELb1EE16insert_fixed_lenERKN3COWINS1_7IColumnEE13immutable_ptrIS6_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIlEELb1ELb1EE16insert_fixed_lenERKN3COWINS1_7IColumnEE13immutable_ptrIS6_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized12Decimal128V3ELb1ELb1EE16insert_fixed_lenERKN3COWINS1_7IColumnEE13immutable_ptrIS5_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIN4wide7integerILm256EiEEEELb1ELb1EE16insert_fixed_lenERKN3COWINS1_7IColumnEE13immutable_ptrIS9_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIjLb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIoLb1ELb1EE16insert_fixed_lenERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
72
73
    void _update_batch_string(const auto& column_string, const uint8_t* __restrict nullmap,
74
0
                              size_t start, size_t size) {
75
0
        for (size_t i = start; i < size; i++) {
76
0
            if (nullmap == nullptr || !nullmap[i]) {
77
0
                if constexpr (NeedMin) {
78
0
                    _min = std::min(_min, column_string.get_data_at(i));
79
0
                }
80
0
                if constexpr (NeedMax) {
81
0
                    _max = std::max(_max, column_string.get_data_at(i));
82
0
                }
83
0
            }
84
0
        }
85
0
        store_string_ref();
86
0
    }
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EE20_update_batch_stringINS_10vectorized9ColumnStrImEEEEvRKT_PKhmm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EE20_update_batch_stringINS_10vectorized9ColumnStrIjEEEEvRKT_PKhmm
87
88
0
    void update_batch(const vectorized::ColumnPtr& column, size_t start) {
89
0
        const auto size = column->size();
90
0
        if constexpr (std::is_same_v<T, StringRef>) {
91
0
            if (column->is_column_string64()) {
92
0
                _update_batch_string(assert_cast<const vectorized::ColumnString64&>(*column),
93
0
                                     nullptr, start, size);
94
0
            } else {
95
0
                _update_batch_string(assert_cast<const vectorized::ColumnString&>(*column), nullptr,
96
0
                                     start, size);
97
0
            }
98
0
        } else {
99
0
            const T* data = (T*)column->get_raw_data().data;
100
0
            for (size_t i = start; i < size; i++) {
101
0
                if constexpr (NeedMin) {
102
0
                    _min = std::min(_min, *(data + i));
103
0
                }
104
0
                if constexpr (NeedMax) {
105
0
                    _max = std::max(_max, *(data + i));
106
0
                }
107
0
            }
108
0
        }
109
0
    }
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIbLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_14DecimalV2ValueELb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS5_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIaLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIsLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIiLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIlLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncInLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIfLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIdLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_16VecDateTimeValueELb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS5_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_15DateV2ValueTypeEEELb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS7_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS7_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS5_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIiEELb1ELb1EE12update_batchERKN3COWINS1_7IColumnEE13immutable_ptrIS6_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIlEELb1ELb1EE12update_batchERKN3COWINS1_7IColumnEE13immutable_ptrIS6_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized12Decimal128V3ELb1ELb1EE12update_batchERKN3COWINS1_7IColumnEE13immutable_ptrIS5_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIN4wide7integerILm256EiEEEELb1ELb1EE12update_batchERKN3COWINS1_7IColumnEE13immutable_ptrIS9_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIjLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIoLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EEm
110
111
    void update_batch(const vectorized::ColumnPtr& column, const vectorized::NullMap& nullmap,
112
0
                      size_t start) {
113
0
        const auto size = column->size();
114
0
        if constexpr (std::is_same_v<T, StringRef>) {
115
0
            if (column->is_column_string64()) {
116
0
                _update_batch_string(assert_cast<const vectorized::ColumnString64&>(*column),
117
0
                                     nullmap.data(), start, size);
118
0
            } else {
119
0
                _update_batch_string(assert_cast<const vectorized::ColumnString&>(*column),
120
0
                                     nullmap.data(), start, size);
121
0
            }
122
0
        } else {
123
0
            const T* data = (T*)column->get_raw_data().data;
124
0
            for (size_t i = start; i < size; i++) {
125
0
                if (!nullmap[i]) {
126
0
                    if constexpr (NeedMin) {
127
0
                        _min = std::min(_min, *(data + i));
128
0
                    }
129
0
                    if constexpr (NeedMax) {
130
0
                        _max = std::max(_max, *(data + i));
131
0
                    }
132
0
                }
133
0
            }
134
0
        }
135
0
    }
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIbLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EERKNS3_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_14DecimalV2ValueELb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS5_EERKNS4_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIaLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EERKNS3_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIsLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EERKNS3_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIiLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EERKNS3_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIlLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EERKNS3_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncInLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EERKNS3_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIfLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EERKNS3_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIdLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EERKNS3_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_16VecDateTimeValueELb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS5_EERKNS4_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_15DateV2ValueTypeEEELb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS7_EERKNS6_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS7_EERKNS6_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS5_EERKNS4_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIiEELb1ELb1EE12update_batchERKN3COWINS1_7IColumnEE13immutable_ptrIS6_EERKNS1_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIlEELb1ELb1EE12update_batchERKN3COWINS1_7IColumnEE13immutable_ptrIS6_EERKNS1_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized12Decimal128V3ELb1ELb1EE12update_batchERKN3COWINS1_7IColumnEE13immutable_ptrIS5_EERKNS1_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIN4wide7integerILm256EiEEEELb1ELb1EE12update_batchERKN3COWINS1_7IColumnEE13immutable_ptrIS9_EERKNS1_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIjLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EERKNS3_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIoLb1ELb1EE12update_batchERKN3COWINS_10vectorized7IColumnEE13immutable_ptrIS4_EERKNS3_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm16EEEm
136
137
0
    Status merge(MinMaxFuncBase* minmax_func) override {
138
0
        if constexpr (std::is_same_v<T, StringRef>) {
139
0
            auto* other_minmax = static_cast<MinMaxNumFunc<T>*>(minmax_func);
140
0
            if constexpr (NeedMin) {
141
0
                _min = std::min(_min, other_minmax->_min);
142
0
            }
143
0
            if constexpr (NeedMax) {
144
0
                _max = std::max(_max, other_minmax->_max);
145
0
            }
146
0
            store_string_ref();
147
0
        } else {
148
0
            auto* other_minmax = static_cast<MinMaxNumFunc<T>*>(minmax_func);
149
0
            if constexpr (NeedMin) {
150
0
                if (other_minmax->_min < _min) {
151
0
                    _min = other_minmax->_min;
152
0
                }
153
0
            }
154
0
            if constexpr (NeedMax) {
155
0
                if (other_minmax->_max > _max) {
156
0
                    _max = other_minmax->_max;
157
0
                }
158
0
            }
159
0
        }
160
161
0
        _contain_null |= minmax_func->contain_null();
162
0
        return Status::OK();
163
0
    }
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIbLb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_14DecimalV2ValueELb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIaLb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIsLb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIiLb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIlLb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncInLb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIfLb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIdLb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_16VecDateTimeValueELb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_15DateV2ValueTypeEEELb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIiEELb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIlEELb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized12Decimal128V3ELb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIN4wide7integerILm256EiEEEELb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIjLb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIoLb1ELb1EE5mergeEPNS_14MinMaxFuncBaseE
164
165
0
    void* get_max() override { return &_max; }
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIbLb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_14DecimalV2ValueELb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIaLb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIsLb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIiLb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIlLb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncInLb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIfLb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIdLb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_16VecDateTimeValueELb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_15DateV2ValueTypeEEELb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIiEELb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIlEELb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized12Decimal128V3ELb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIN4wide7integerILm256EiEEEELb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIjLb1ELb1EE7get_maxEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIoLb1ELb1EE7get_maxEv
166
167
0
    void* get_min() override { return &_min; }
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIbLb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_14DecimalV2ValueELb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIaLb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIsLb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIiLb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIlLb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncInLb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIfLb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIdLb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_16VecDateTimeValueELb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_15DateV2ValueTypeEEELb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIiEELb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIlEELb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized12Decimal128V3ELb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIN4wide7integerILm256EiEEEELb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIjLb1ELb1EE7get_minEv
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIoLb1ELb1EE7get_minEv
168
169
0
    Status assign(void* min_data, void* max_data) override {
170
0
        _min = *(T*)min_data;
171
0
        _max = *(T*)max_data;
172
0
        return Status::OK();
173
0
    }
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIbLb1ELb1EE6assignEPvS2_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_14DecimalV2ValueELb1ELb1EE6assignEPvS3_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIaLb1ELb1EE6assignEPvS2_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIsLb1ELb1EE6assignEPvS2_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIiLb1ELb1EE6assignEPvS2_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIlLb1ELb1EE6assignEPvS2_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncInLb1ELb1EE6assignEPvS2_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIfLb1ELb1EE6assignEPvS2_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIdLb1ELb1EE6assignEPvS2_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_16VecDateTimeValueELb1ELb1EE6assignEPvS3_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_15DateV2ValueTypeEEELb1ELb1EE6assignEPvS5_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_11DateV2ValueINS_19DateTimeV2ValueTypeEEELb1ELb1EE6assignEPvS5_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_9StringRefELb1ELb1EE6assignEPvS3_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIiEELb1ELb1EE6assignEPvS5_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIlEELb1ELb1EE6assignEPvS5_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized12Decimal128V3ELb1ELb1EE6assignEPvS4_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncINS_10vectorized7DecimalIN4wide7integerILm256EiEEEELb1ELb1EE6assignEPvS8_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIjLb1ELb1EE6assignEPvS2_
Unexecuted instantiation: _ZN5doris13MinMaxNumFuncIoLb1ELb1EE6assignEPvS2_
174
175
0
    void store_string_ref() {
176
0
        if constexpr (std::is_same_v<T, StringRef>) {
177
0
            if constexpr (NeedMin) {
178
0
                if (_min.data != _stored_min.data()) {
179
0
                    _stored_min = _min.to_string();
180
0
                    _min = StringRef(_stored_min);
181
0
                }
182
0
            }
183
0
            if constexpr (NeedMax) {
184
0
                if (_max.data != _stored_max.data()) {
185
0
                    _stored_max = _max.to_string();
186
0
                    _max = StringRef(_stored_max);
187
0
                }
188
0
            }
189
0
        }
190
0
    }
191
192
protected:
193
    T _max = type_limit<T>::min();
194
    T _min = type_limit<T>::max();
195
    std::string _stored_min;
196
    std::string _stored_max;
197
};
198
199
template <class T>
200
using MinNumFunc = MinMaxNumFunc<T, false, true>;
201
202
template <class T>
203
using MaxNumFunc = MinMaxNumFunc<T, true, false>;
204
205
} // namespace doris