be/src/exprs/aggregate/aggregate_function_stddev.h
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #pragma once |
19 | | |
20 | | #include <boost/iterator/iterator_facade.hpp> |
21 | | #include <cmath> |
22 | | #include <cstddef> |
23 | | #include <cstdint> |
24 | | #include <memory> |
25 | | #include <type_traits> |
26 | | |
27 | | #include "core/assert_cast.h" |
28 | | #include "core/column/column.h" |
29 | | #include "core/column/column_nullable.h" |
30 | | #include "core/data_type/data_type_decimal.h" |
31 | | #include "core/data_type/data_type_number.h" |
32 | | #include "core/types.h" |
33 | | #include "exprs/aggregate/aggregate_function.h" |
34 | | |
35 | | namespace doris { |
36 | | class Arena; |
37 | | class BufferReadable; |
38 | | class BufferWritable; |
39 | | template <PrimitiveType T> |
40 | | class ColumnDecimal; |
41 | | template <PrimitiveType T> |
42 | | class ColumnVector; |
43 | | |
44 | | template <PrimitiveType T, bool is_stddev> |
45 | | struct BaseData { |
46 | 8.86k | BaseData() = default; _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EEC2Ev Line | Count | Source | 46 | 4.61k | BaseData() = default; |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EEC2Ev Line | Count | Source | 46 | 4.25k | BaseData() = default; |
|
47 | 8.84k | virtual ~BaseData() = default; _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EED2Ev Line | Count | Source | 47 | 4.60k | virtual ~BaseData() = default; |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EED2Ev Line | Count | Source | 47 | 4.24k | virtual ~BaseData() = default; |
|
48 | | |
49 | 3.43k | void write(BufferWritable& buf) const { |
50 | 3.43k | buf.write_binary(mean); |
51 | 3.43k | buf.write_binary(m2); |
52 | 3.43k | buf.write_binary(count); |
53 | 3.43k | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE5writeERNS_14BufferWritableE Line | Count | Source | 49 | 1.80k | void write(BufferWritable& buf) const { | 50 | 1.80k | buf.write_binary(mean); | 51 | 1.80k | buf.write_binary(m2); | 52 | 1.80k | buf.write_binary(count); | 53 | 1.80k | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE5writeERNS_14BufferWritableE Line | Count | Source | 49 | 1.63k | void write(BufferWritable& buf) const { | 50 | 1.63k | buf.write_binary(mean); | 51 | 1.63k | buf.write_binary(m2); | 52 | 1.63k | buf.write_binary(count); | 53 | 1.63k | } |
|
54 | | |
55 | 3.31k | void read(BufferReadable& buf) { |
56 | 3.31k | buf.read_binary(mean); |
57 | 3.31k | buf.read_binary(m2); |
58 | 3.31k | buf.read_binary(count); |
59 | 3.31k | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE4readERNS_14BufferReadableE Line | Count | Source | 55 | 1.75k | void read(BufferReadable& buf) { | 56 | 1.75k | buf.read_binary(mean); | 57 | 1.75k | buf.read_binary(m2); | 58 | 1.75k | buf.read_binary(count); | 59 | 1.75k | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE4readERNS_14BufferReadableE Line | Count | Source | 55 | 1.55k | void read(BufferReadable& buf) { | 56 | 1.55k | buf.read_binary(mean); | 57 | 1.55k | buf.read_binary(m2); | 58 | 1.55k | buf.read_binary(count); | 59 | 1.55k | } |
|
60 | | |
61 | 842 | void reset() { |
62 | 842 | mean = 0.0; |
63 | 842 | m2 = 0.0; |
64 | 842 | count = 0; |
65 | 842 | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE5resetEv Line | Count | Source | 61 | 434 | void reset() { | 62 | 434 | mean = 0.0; | 63 | 434 | m2 = 0.0; | 64 | 434 | count = 0; | 65 | 434 | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE5resetEv Line | Count | Source | 61 | 408 | void reset() { | 62 | 408 | mean = 0.0; | 63 | 408 | m2 = 0.0; | 64 | 408 | count = 0; | 65 | 408 | } |
|
66 | | |
67 | 1.34k | double get_result(double res) const { |
68 | 1.34k | auto inf_to_nan = [](double val) { |
69 | | // This function performs squaring operations, and due to differences in computation order, |
70 | | // it might produce different values such as inf and nan. |
71 | | // In MySQL, this will directly result in an error due to exceeding the double range. |
72 | | // For performance reasons, we are uniformly changing it to nan |
73 | 1.34k | if (std::isinf(val)) { |
74 | 0 | return std::nan(""); |
75 | 0 | } |
76 | 1.34k | return val; |
77 | 1.34k | }; _ZZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE10get_resultEdENKUldE_clEd Line | Count | Source | 68 | 685 | auto inf_to_nan = [](double val) { | 69 | | // This function performs squaring operations, and due to differences in computation order, | 70 | | // it might produce different values such as inf and nan. | 71 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 72 | | // For performance reasons, we are uniformly changing it to nan | 73 | 685 | if (std::isinf(val)) { | 74 | 0 | return std::nan(""); | 75 | 0 | } | 76 | 685 | return val; | 77 | 685 | }; |
_ZZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE10get_resultEdENKUldE_clEd Line | Count | Source | 68 | 662 | auto inf_to_nan = [](double val) { | 69 | | // This function performs squaring operations, and due to differences in computation order, | 70 | | // it might produce different values such as inf and nan. | 71 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 72 | | // For performance reasons, we are uniformly changing it to nan | 73 | 662 | if (std::isinf(val)) { | 74 | 0 | return std::nan(""); | 75 | 0 | } | 76 | 662 | return val; | 77 | 662 | }; |
|
78 | 1.34k | if constexpr (is_stddev) { |
79 | 662 | return inf_to_nan(std::sqrt(res)); |
80 | 685 | } else { |
81 | 685 | return inf_to_nan(res); |
82 | 685 | } |
83 | 1.34k | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE10get_resultEd Line | Count | Source | 67 | 685 | double get_result(double res) const { | 68 | 685 | auto inf_to_nan = [](double val) { | 69 | | // This function performs squaring operations, and due to differences in computation order, | 70 | | // it might produce different values such as inf and nan. | 71 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 72 | | // For performance reasons, we are uniformly changing it to nan | 73 | 685 | if (std::isinf(val)) { | 74 | 685 | return std::nan(""); | 75 | 685 | } | 76 | 685 | return val; | 77 | 685 | }; | 78 | | if constexpr (is_stddev) { | 79 | | return inf_to_nan(std::sqrt(res)); | 80 | 685 | } else { | 81 | 685 | return inf_to_nan(res); | 82 | 685 | } | 83 | 685 | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE10get_resultEd Line | Count | Source | 67 | 662 | double get_result(double res) const { | 68 | 662 | auto inf_to_nan = [](double val) { | 69 | | // This function performs squaring operations, and due to differences in computation order, | 70 | | // it might produce different values such as inf and nan. | 71 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 72 | | // For performance reasons, we are uniformly changing it to nan | 73 | 662 | if (std::isinf(val)) { | 74 | 662 | return std::nan(""); | 75 | 662 | } | 76 | 662 | return val; | 77 | 662 | }; | 78 | 662 | if constexpr (is_stddev) { | 79 | 662 | return inf_to_nan(std::sqrt(res)); | 80 | | } else { | 81 | | return inf_to_nan(res); | 82 | | } | 83 | 662 | } |
|
84 | | |
85 | 1.18k | double get_pop_result() const { |
86 | 1.18k | if (count == 1) { |
87 | 484 | return 0.0; |
88 | 484 | } |
89 | 702 | double res = m2 / (double)count; |
90 | 702 | return get_result(res); |
91 | 1.18k | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE14get_pop_resultEv Line | Count | Source | 85 | 598 | double get_pop_result() const { | 86 | 598 | if (count == 1) { | 87 | 242 | return 0.0; | 88 | 242 | } | 89 | 356 | double res = m2 / (double)count; | 90 | 356 | return get_result(res); | 91 | 598 | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE14get_pop_resultEv Line | Count | Source | 85 | 588 | double get_pop_result() const { | 86 | 588 | if (count == 1) { | 87 | 242 | return 0.0; | 88 | 242 | } | 89 | 346 | double res = m2 / (double)count; | 90 | 346 | return get_result(res); | 91 | 588 | } |
|
92 | | |
93 | 645 | double get_samp_result() const { |
94 | 645 | double res = m2 / double(count - 1); |
95 | 645 | return get_result(res); |
96 | 645 | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE15get_samp_resultEv Line | Count | Source | 93 | 329 | double get_samp_result() const { | 94 | 329 | double res = m2 / double(count - 1); | 95 | 329 | return get_result(res); | 96 | 329 | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE15get_samp_resultEv Line | Count | Source | 93 | 316 | double get_samp_result() const { | 94 | 316 | double res = m2 / double(count - 1); | 95 | 316 | return get_result(res); | 96 | 316 | } |
|
97 | | |
98 | 3.31k | void merge(const BaseData& rhs) { |
99 | 3.31k | if (rhs.count == 0) { |
100 | 92 | return; |
101 | 92 | } |
102 | 3.22k | double delta = mean - rhs.mean; |
103 | 3.22k | double sum_count = double(count + rhs.count); |
104 | 3.22k | mean = rhs.mean + delta * (double)count / sum_count; |
105 | 3.22k | m2 = rhs.m2 + m2 + (delta * delta) * (double)rhs.count * (double)count / sum_count; |
106 | 3.22k | count = int64_t(sum_count); |
107 | 3.22k | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE5mergeERKS2_ Line | Count | Source | 98 | 1.75k | void merge(const BaseData& rhs) { | 99 | 1.75k | if (rhs.count == 0) { | 100 | 47 | return; | 101 | 47 | } | 102 | 1.70k | double delta = mean - rhs.mean; | 103 | 1.70k | double sum_count = double(count + rhs.count); | 104 | 1.70k | mean = rhs.mean + delta * (double)count / sum_count; | 105 | 1.70k | m2 = rhs.m2 + m2 + (delta * delta) * (double)rhs.count * (double)count / sum_count; | 106 | 1.70k | count = int64_t(sum_count); | 107 | 1.70k | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE5mergeERKS2_ Line | Count | Source | 98 | 1.55k | void merge(const BaseData& rhs) { | 99 | 1.55k | if (rhs.count == 0) { | 100 | 45 | return; | 101 | 45 | } | 102 | 1.51k | double delta = mean - rhs.mean; | 103 | 1.51k | double sum_count = double(count + rhs.count); | 104 | 1.51k | mean = rhs.mean + delta * (double)count / sum_count; | 105 | 1.51k | m2 = rhs.m2 + m2 + (delta * delta) * (double)rhs.count * (double)count / sum_count; | 106 | 1.51k | count = int64_t(sum_count); | 107 | 1.51k | } |
|
108 | | |
109 | 6.20k | void add(const IColumn* column, size_t row_num) { |
110 | 6.20k | const auto& sources = assert_cast<const typename PrimitiveTypeTraits<T>::ColumnType&, |
111 | 6.20k | TypeCheckOnRelease::DISABLE>(*column); |
112 | 6.20k | double source_data = (double)sources.get_data()[row_num]; |
113 | | |
114 | 6.20k | double delta = source_data - mean; |
115 | 6.20k | double r = delta / double(1 + count); |
116 | 6.20k | mean += r; |
117 | 6.20k | m2 += (double)count * delta * r; |
118 | 6.20k | count += 1; |
119 | 6.20k | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE3addEPKNS_7IColumnEm Line | Count | Source | 109 | 3.14k | void add(const IColumn* column, size_t row_num) { | 110 | 3.14k | const auto& sources = assert_cast<const typename PrimitiveTypeTraits<T>::ColumnType&, | 111 | 3.14k | TypeCheckOnRelease::DISABLE>(*column); | 112 | 3.14k | double source_data = (double)sources.get_data()[row_num]; | 113 | | | 114 | 3.14k | double delta = source_data - mean; | 115 | 3.14k | double r = delta / double(1 + count); | 116 | 3.14k | mean += r; | 117 | 3.14k | m2 += (double)count * delta * r; | 118 | 3.14k | count += 1; | 119 | 3.14k | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE3addEPKNS_7IColumnEm Line | Count | Source | 109 | 3.06k | void add(const IColumn* column, size_t row_num) { | 110 | 3.06k | const auto& sources = assert_cast<const typename PrimitiveTypeTraits<T>::ColumnType&, | 111 | 3.06k | TypeCheckOnRelease::DISABLE>(*column); | 112 | 3.06k | double source_data = (double)sources.get_data()[row_num]; | 113 | | | 114 | 3.06k | double delta = source_data - mean; | 115 | 3.06k | double r = delta / double(1 + count); | 116 | 3.06k | mean += r; | 117 | 3.06k | m2 += (double)count * delta * r; | 118 | 3.06k | count += 1; | 119 | 3.06k | } |
|
120 | | |
121 | | double mean {}; |
122 | | double m2 {}; |
123 | | int64_t count {}; |
124 | | }; |
125 | | |
126 | | template <PrimitiveType T, typename Name, bool is_stddev> |
127 | | struct PopData : BaseData<T, is_stddev>, Name { |
128 | | using ColVecResult = std::conditional_t<is_decimal(T), ColumnDecimal128V2, ColumnFloat64>; |
129 | 1.18k | void insert_result_into(IColumn& to) const { |
130 | 1.18k | auto& col = assert_cast<ColVecResult&>(to); |
131 | | if constexpr (is_decimal(T)) { |
132 | | col.get_data().push_back(this->get_pop_result().value()); |
133 | 1.18k | } else { |
134 | 1.18k | col.get_data().push_back(this->get_pop_result()); |
135 | 1.18k | } |
136 | 1.18k | } _ZNK5doris7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 129 | 597 | void insert_result_into(IColumn& to) const { | 130 | 597 | auto& col = assert_cast<ColVecResult&>(to); | 131 | | if constexpr (is_decimal(T)) { | 132 | | col.get_data().push_back(this->get_pop_result().value()); | 133 | 597 | } else { | 134 | 597 | col.get_data().push_back(this->get_pop_result()); | 135 | 597 | } | 136 | 597 | } |
_ZNK5doris7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 129 | 588 | void insert_result_into(IColumn& to) const { | 130 | 588 | auto& col = assert_cast<ColVecResult&>(to); | 131 | | if constexpr (is_decimal(T)) { | 132 | | col.get_data().push_back(this->get_pop_result().value()); | 133 | 588 | } else { | 134 | 588 | col.get_data().push_back(this->get_pop_result()); | 135 | 588 | } | 136 | 588 | } |
|
137 | | |
138 | 1.04k | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); }_ZN5doris7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EE15get_return_typeEv Line | Count | Source | 138 | 546 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
_ZN5doris7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EE15get_return_typeEv Line | Count | Source | 138 | 501 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
|
139 | | }; |
140 | | |
141 | | // For this series of functions, the Decimal type is not supported |
142 | | // because the operations involve squaring, |
143 | | // which can easily exceed the range of the Decimal type. |
144 | | |
145 | | template <PrimitiveType T, typename Name, bool is_stddev> |
146 | | struct SampData : BaseData<T, is_stddev>, Name { |
147 | | using ColVecResult = std::conditional_t<is_decimal(T), ColumnDecimal128V2, ColumnFloat64>; |
148 | 1.12k | void insert_result_into(IColumn& to) const { |
149 | 1.12k | auto& col = assert_cast<ColVecResult&>(to); |
150 | 1.12k | if (this->count == 1 || this->count == 0) { |
151 | 483 | col.insert_default(); |
152 | 645 | } else { |
153 | | if constexpr (is_decimal(T)) { |
154 | | col.get_data().push_back(this->get_samp_result().value()); |
155 | 645 | } else { |
156 | 645 | col.get_data().push_back(this->get_samp_result()); |
157 | 645 | } |
158 | 645 | } |
159 | 1.12k | } _ZNK5doris8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 148 | 573 | void insert_result_into(IColumn& to) const { | 149 | 573 | auto& col = assert_cast<ColVecResult&>(to); | 150 | 573 | if (this->count == 1 || this->count == 0) { | 151 | 244 | col.insert_default(); | 152 | 329 | } else { | 153 | | if constexpr (is_decimal(T)) { | 154 | | col.get_data().push_back(this->get_samp_result().value()); | 155 | 329 | } else { | 156 | 329 | col.get_data().push_back(this->get_samp_result()); | 157 | 329 | } | 158 | 329 | } | 159 | 573 | } |
_ZNK5doris8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 148 | 555 | void insert_result_into(IColumn& to) const { | 149 | 555 | auto& col = assert_cast<ColVecResult&>(to); | 150 | 555 | if (this->count == 1 || this->count == 0) { | 151 | 239 | col.insert_default(); | 152 | 316 | } else { | 153 | | if constexpr (is_decimal(T)) { | 154 | | col.get_data().push_back(this->get_samp_result().value()); | 155 | 316 | } else { | 156 | 316 | col.get_data().push_back(this->get_samp_result()); | 157 | 316 | } | 158 | 316 | } | 159 | 555 | } |
|
160 | | |
161 | 918 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); }_ZN5doris8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EE15get_return_typeEv Line | Count | Source | 161 | 467 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
_ZN5doris8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EE15get_return_typeEv Line | Count | Source | 161 | 451 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
|
162 | | }; |
163 | | |
164 | | struct StddevName { |
165 | 197 | static const char* name() { return "stddev"; } |
166 | | }; |
167 | | struct VarianceName { |
168 | 196 | static const char* name() { return "variance"; } |
169 | | }; |
170 | | struct VarianceSampName { |
171 | 197 | static const char* name() { return "variance_samp"; } |
172 | | }; |
173 | | struct StddevSampName { |
174 | 174 | static const char* name() { return "stddev_samp"; } |
175 | | }; |
176 | | |
177 | | template <typename Data> |
178 | | class AggregateFunctionSampVariance |
179 | | : public IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>, |
180 | | UnaryExpression, |
181 | | NullableAggregateFunction { |
182 | | public: |
183 | | AggregateFunctionSampVariance(const DataTypes& argument_types_) |
184 | 3.42k | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( |
185 | 3.42k | argument_types_) {}_ZN5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 184 | 943 | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 185 | 943 | argument_types_) {} |
_ZN5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 184 | 984 | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 185 | 984 | argument_types_) {} |
_ZN5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 184 | 959 | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 185 | 959 | argument_types_) {} |
_ZN5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 184 | 536 | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 185 | 536 | argument_types_) {} |
|
186 | | |
187 | 764 | String get_name() const override { return Data::name(); }_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE8get_nameB5cxx11Ev Line | Count | Source | 187 | 197 | String get_name() const override { return Data::name(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE8get_nameB5cxx11Ev Line | Count | Source | 187 | 196 | String get_name() const override { return Data::name(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE8get_nameB5cxx11Ev Line | Count | Source | 187 | 196 | String get_name() const override { return Data::name(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE8get_nameB5cxx11Ev Line | Count | Source | 187 | 175 | String get_name() const override { return Data::name(); } |
|
188 | | |
189 | 1.96k | DataTypePtr get_return_type() const override { return Data::get_return_type(); }_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE15get_return_typeEv Line | Count | Source | 189 | 467 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE15get_return_typeEv Line | Count | Source | 189 | 546 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE15get_return_typeEv Line | Count | Source | 189 | 501 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE15get_return_typeEv Line | Count | Source | 189 | 451 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
|
190 | | |
191 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
192 | 6.20k | Arena&) const override { |
193 | 6.20k | this->data(place).add(columns[0], row_num); |
194 | 6.20k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 192 | 1.48k | Arena&) const override { | 193 | 1.48k | this->data(place).add(columns[0], row_num); | 194 | 1.48k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 192 | 1.66k | Arena&) const override { | 193 | 1.66k | this->data(place).add(columns[0], row_num); | 194 | 1.66k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 192 | 1.62k | Arena&) const override { | 193 | 1.62k | this->data(place).add(columns[0], row_num); | 194 | 1.62k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 192 | 1.44k | Arena&) const override { | 193 | 1.44k | this->data(place).add(columns[0], row_num); | 194 | 1.44k | } |
|
195 | | |
196 | 842 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); }_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE5resetEPc Line | Count | Source | 196 | 217 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE5resetEPc Line | Count | Source | 196 | 217 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE5resetEPc Line | Count | Source | 196 | 217 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE5resetEPc Line | Count | Source | 196 | 191 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
|
197 | | |
198 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
199 | 3.31k | Arena&) const override { |
200 | 3.31k | this->data(place).merge(this->data(rhs)); |
201 | 3.31k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 199 | 829 | Arena&) const override { | 200 | 829 | this->data(place).merge(this->data(rhs)); | 201 | 829 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 199 | 927 | Arena&) const override { | 200 | 927 | this->data(place).merge(this->data(rhs)); | 201 | 927 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 199 | 855 | Arena&) const override { | 200 | 855 | this->data(place).merge(this->data(rhs)); | 201 | 855 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 199 | 703 | Arena&) const override { | 200 | 703 | this->data(place).merge(this->data(rhs)); | 201 | 703 | } |
|
202 | | |
203 | 3.43k | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
204 | 3.43k | this->data(place).write(buf); |
205 | 3.43k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 203 | 852 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 204 | 852 | this->data(place).write(buf); | 205 | 852 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 203 | 953 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 204 | 953 | this->data(place).write(buf); | 205 | 953 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 203 | 879 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 204 | 879 | this->data(place).write(buf); | 205 | 879 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 203 | 751 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 204 | 751 | this->data(place).write(buf); | 205 | 751 | } |
|
206 | | |
207 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
208 | 3.31k | Arena&) const override { |
209 | 3.31k | this->data(place).read(buf); |
210 | 3.31k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 208 | 829 | Arena&) const override { | 209 | 829 | this->data(place).read(buf); | 210 | 829 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 208 | 927 | Arena&) const override { | 209 | 927 | this->data(place).read(buf); | 210 | 927 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 208 | 855 | Arena&) const override { | 209 | 855 | this->data(place).read(buf); | 210 | 855 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 208 | 703 | Arena&) const override { | 209 | 703 | this->data(place).read(buf); | 210 | 703 | } |
|
211 | | |
212 | 2.31k | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
213 | 2.31k | this->data(place).insert_result_into(to); |
214 | 2.31k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 212 | 573 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 213 | 573 | this->data(place).insert_result_into(to); | 214 | 573 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 212 | 598 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 213 | 598 | this->data(place).insert_result_into(to); | 214 | 598 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 212 | 588 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 213 | 588 | this->data(place).insert_result_into(to); | 214 | 588 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 212 | 555 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 213 | 555 | this->data(place).insert_result_into(to); | 214 | 555 | } |
|
215 | | }; |
216 | | |
217 | | } // namespace doris |