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 | | #include "common/compile_check_begin.h" |
37 | | class Arena; |
38 | | class BufferReadable; |
39 | | class BufferWritable; |
40 | | template <PrimitiveType T> |
41 | | class ColumnDecimal; |
42 | | template <PrimitiveType T> |
43 | | class ColumnVector; |
44 | | |
45 | | template <PrimitiveType T, bool is_stddev> |
46 | | struct BaseData { |
47 | 10.1k | BaseData() = default; _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EEC2Ev Line | Count | Source | 47 | 5.40k | BaseData() = default; |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EEC2Ev Line | Count | Source | 47 | 4.75k | BaseData() = default; |
|
48 | 10.1k | virtual ~BaseData() = default; _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EED2Ev Line | Count | Source | 48 | 5.39k | virtual ~BaseData() = default; |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EED2Ev Line | Count | Source | 48 | 4.75k | virtual ~BaseData() = default; |
|
49 | | |
50 | 3.91k | void write(BufferWritable& buf) const { |
51 | 3.91k | buf.write_binary(mean); |
52 | 3.91k | buf.write_binary(m2); |
53 | 3.91k | buf.write_binary(count); |
54 | 3.91k | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE5writeERNS_14BufferWritableE Line | Count | Source | 50 | 2.08k | void write(BufferWritable& buf) const { | 51 | 2.08k | buf.write_binary(mean); | 52 | 2.08k | buf.write_binary(m2); | 53 | 2.08k | buf.write_binary(count); | 54 | 2.08k | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE5writeERNS_14BufferWritableE Line | Count | Source | 50 | 1.83k | void write(BufferWritable& buf) const { | 51 | 1.83k | buf.write_binary(mean); | 52 | 1.83k | buf.write_binary(m2); | 53 | 1.83k | buf.write_binary(count); | 54 | 1.83k | } |
|
55 | | |
56 | 3.78k | void read(BufferReadable& buf) { |
57 | 3.78k | buf.read_binary(mean); |
58 | 3.78k | buf.read_binary(m2); |
59 | 3.78k | buf.read_binary(count); |
60 | 3.78k | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE4readERNS_14BufferReadableE Line | Count | Source | 56 | 2.02k | void read(BufferReadable& buf) { | 57 | 2.02k | buf.read_binary(mean); | 58 | 2.02k | buf.read_binary(m2); | 59 | 2.02k | buf.read_binary(count); | 60 | 2.02k | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE4readERNS_14BufferReadableE Line | Count | Source | 56 | 1.75k | void read(BufferReadable& buf) { | 57 | 1.75k | buf.read_binary(mean); | 58 | 1.75k | buf.read_binary(m2); | 59 | 1.75k | buf.read_binary(count); | 60 | 1.75k | } |
|
61 | | |
62 | 1.05k | void reset() { |
63 | 1.05k | mean = 0.0; |
64 | 1.05k | m2 = 0.0; |
65 | 1.05k | count = 0; |
66 | 1.05k | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE5resetEv Line | Count | Source | 62 | 542 | void reset() { | 63 | 542 | mean = 0.0; | 64 | 542 | m2 = 0.0; | 65 | 542 | count = 0; | 66 | 542 | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE5resetEv Line | Count | Source | 62 | 514 | void reset() { | 63 | 514 | mean = 0.0; | 64 | 514 | m2 = 0.0; | 65 | 514 | count = 0; | 66 | 514 | } |
|
67 | | |
68 | 1.66k | double get_result(double res) const { |
69 | 1.66k | auto inf_to_nan = [](double val) { |
70 | | // This function performs squaring operations, and due to differences in computation order, |
71 | | // it might produce different values such as inf and nan. |
72 | | // In MySQL, this will directly result in an error due to exceeding the double range. |
73 | | // For performance reasons, we are uniformly changing it to nan |
74 | 1.66k | if (std::isinf(val)) { |
75 | 0 | return std::nan(""); |
76 | 0 | } |
77 | 1.66k | return val; |
78 | 1.66k | }; _ZZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE10get_resultEdENKUldE_clEd Line | Count | Source | 69 | 851 | auto inf_to_nan = [](double val) { | 70 | | // This function performs squaring operations, and due to differences in computation order, | 71 | | // it might produce different values such as inf and nan. | 72 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 73 | | // For performance reasons, we are uniformly changing it to nan | 74 | 851 | if (std::isinf(val)) { | 75 | 0 | return std::nan(""); | 76 | 0 | } | 77 | 851 | return val; | 78 | 851 | }; |
_ZZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE10get_resultEdENKUldE_clEd Line | Count | Source | 69 | 815 | auto inf_to_nan = [](double val) { | 70 | | // This function performs squaring operations, and due to differences in computation order, | 71 | | // it might produce different values such as inf and nan. | 72 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 73 | | // For performance reasons, we are uniformly changing it to nan | 74 | 815 | if (std::isinf(val)) { | 75 | 0 | return std::nan(""); | 76 | 0 | } | 77 | 815 | return val; | 78 | 815 | }; |
|
79 | 1.66k | if constexpr (is_stddev) { |
80 | 815 | return inf_to_nan(std::sqrt(res)); |
81 | 851 | } else { |
82 | 851 | return inf_to_nan(res); |
83 | 851 | } |
84 | 1.66k | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE10get_resultEd Line | Count | Source | 68 | 851 | double get_result(double res) const { | 69 | 851 | auto inf_to_nan = [](double val) { | 70 | | // This function performs squaring operations, and due to differences in computation order, | 71 | | // it might produce different values such as inf and nan. | 72 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 73 | | // For performance reasons, we are uniformly changing it to nan | 74 | 851 | if (std::isinf(val)) { | 75 | 851 | return std::nan(""); | 76 | 851 | } | 77 | 851 | return val; | 78 | 851 | }; | 79 | | if constexpr (is_stddev) { | 80 | | return inf_to_nan(std::sqrt(res)); | 81 | 851 | } else { | 82 | 851 | return inf_to_nan(res); | 83 | 851 | } | 84 | 851 | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE10get_resultEd Line | Count | Source | 68 | 815 | double get_result(double res) const { | 69 | 815 | auto inf_to_nan = [](double val) { | 70 | | // This function performs squaring operations, and due to differences in computation order, | 71 | | // it might produce different values such as inf and nan. | 72 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 73 | | // For performance reasons, we are uniformly changing it to nan | 74 | 815 | if (std::isinf(val)) { | 75 | 815 | return std::nan(""); | 76 | 815 | } | 77 | 815 | return val; | 78 | 815 | }; | 79 | 815 | if constexpr (is_stddev) { | 80 | 815 | return inf_to_nan(std::sqrt(res)); | 81 | | } else { | 82 | | return inf_to_nan(res); | 83 | | } | 84 | 815 | } |
|
85 | | |
86 | 1.39k | double get_pop_result() const { |
87 | 1.39k | if (count == 1) { |
88 | 526 | return 0.0; |
89 | 526 | } |
90 | 866 | double res = m2 / (double)count; |
91 | 866 | return get_result(res); |
92 | 1.39k | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE14get_pop_resultEv Line | Count | Source | 86 | 706 | double get_pop_result() const { | 87 | 706 | if (count == 1) { | 88 | 263 | return 0.0; | 89 | 263 | } | 90 | 443 | double res = m2 / (double)count; | 91 | 443 | return get_result(res); | 92 | 706 | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE14get_pop_resultEv Line | Count | Source | 86 | 686 | double get_pop_result() const { | 87 | 686 | if (count == 1) { | 88 | 263 | return 0.0; | 89 | 263 | } | 90 | 423 | double res = m2 / (double)count; | 91 | 423 | return get_result(res); | 92 | 686 | } |
|
93 | | |
94 | 800 | double get_samp_result() const { |
95 | 800 | double res = m2 / double(count - 1); |
96 | 800 | return get_result(res); |
97 | 800 | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE15get_samp_resultEv Line | Count | Source | 94 | 408 | double get_samp_result() const { | 95 | 408 | double res = m2 / double(count - 1); | 96 | 408 | return get_result(res); | 97 | 408 | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE15get_samp_resultEv Line | Count | Source | 94 | 392 | double get_samp_result() const { | 95 | 392 | double res = m2 / double(count - 1); | 96 | 392 | return get_result(res); | 97 | 392 | } |
|
98 | | |
99 | 3.78k | void merge(const BaseData& rhs) { |
100 | 3.78k | if (rhs.count == 0) { |
101 | 102 | return; |
102 | 102 | } |
103 | 3.67k | double delta = mean - rhs.mean; |
104 | 3.67k | double sum_count = double(count + rhs.count); |
105 | 3.67k | mean = rhs.mean + delta * (double)count / sum_count; |
106 | 3.67k | m2 = rhs.m2 + m2 + (delta * delta) * (double)rhs.count * (double)count / sum_count; |
107 | 3.67k | count = int64_t(sum_count); |
108 | 3.67k | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE5mergeERKS2_ Line | Count | Source | 99 | 2.02k | void merge(const BaseData& rhs) { | 100 | 2.02k | if (rhs.count == 0) { | 101 | 53 | return; | 102 | 53 | } | 103 | 1.97k | double delta = mean - rhs.mean; | 104 | 1.97k | double sum_count = double(count + rhs.count); | 105 | 1.97k | mean = rhs.mean + delta * (double)count / sum_count; | 106 | 1.97k | m2 = rhs.m2 + m2 + (delta * delta) * (double)rhs.count * (double)count / sum_count; | 107 | 1.97k | count = int64_t(sum_count); | 108 | 1.97k | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE5mergeERKS2_ Line | Count | Source | 99 | 1.75k | void merge(const BaseData& rhs) { | 100 | 1.75k | if (rhs.count == 0) { | 101 | 49 | return; | 102 | 49 | } | 103 | 1.70k | double delta = mean - rhs.mean; | 104 | 1.70k | double sum_count = double(count + rhs.count); | 105 | 1.70k | mean = rhs.mean + delta * (double)count / sum_count; | 106 | 1.70k | m2 = rhs.m2 + m2 + (delta * delta) * (double)rhs.count * (double)count / sum_count; | 107 | 1.70k | count = int64_t(sum_count); | 108 | 1.70k | } |
|
109 | | |
110 | 7.20k | void add(const IColumn* column, size_t row_num) { |
111 | 7.20k | const auto& sources = assert_cast<const typename PrimitiveTypeTraits<T>::ColumnType&, |
112 | 7.20k | TypeCheckOnRelease::DISABLE>(*column); |
113 | 7.20k | double source_data = (double)sources.get_data()[row_num]; |
114 | | |
115 | 7.20k | double delta = source_data - mean; |
116 | 7.20k | double r = delta / double(1 + count); |
117 | 7.20k | mean += r; |
118 | 7.20k | m2 += (double)count * delta * r; |
119 | 7.20k | count += 1; |
120 | 7.20k | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE3addEPKNS_7IColumnEm Line | Count | Source | 110 | 3.71k | void add(const IColumn* column, size_t row_num) { | 111 | 3.71k | const auto& sources = assert_cast<const typename PrimitiveTypeTraits<T>::ColumnType&, | 112 | 3.71k | TypeCheckOnRelease::DISABLE>(*column); | 113 | 3.71k | double source_data = (double)sources.get_data()[row_num]; | 114 | | | 115 | 3.71k | double delta = source_data - mean; | 116 | 3.71k | double r = delta / double(1 + count); | 117 | 3.71k | mean += r; | 118 | 3.71k | m2 += (double)count * delta * r; | 119 | 3.71k | count += 1; | 120 | 3.71k | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE3addEPKNS_7IColumnEm Line | Count | Source | 110 | 3.49k | void add(const IColumn* column, size_t row_num) { | 111 | 3.49k | const auto& sources = assert_cast<const typename PrimitiveTypeTraits<T>::ColumnType&, | 112 | 3.49k | TypeCheckOnRelease::DISABLE>(*column); | 113 | 3.49k | double source_data = (double)sources.get_data()[row_num]; | 114 | | | 115 | 3.49k | double delta = source_data - mean; | 116 | 3.49k | double r = delta / double(1 + count); | 117 | 3.49k | mean += r; | 118 | 3.49k | m2 += (double)count * delta * r; | 119 | 3.49k | count += 1; | 120 | 3.49k | } |
|
121 | | |
122 | | double mean {}; |
123 | | double m2 {}; |
124 | | int64_t count {}; |
125 | | }; |
126 | | |
127 | | template <PrimitiveType T, typename Name, bool is_stddev> |
128 | | struct PopData : BaseData<T, is_stddev>, Name { |
129 | | using ColVecResult = std::conditional_t<is_decimal(T), ColumnDecimal128V2, ColumnFloat64>; |
130 | 1.39k | void insert_result_into(IColumn& to) const { |
131 | 1.39k | auto& col = assert_cast<ColVecResult&>(to); |
132 | | if constexpr (is_decimal(T)) { |
133 | | col.get_data().push_back(this->get_pop_result().value()); |
134 | 1.39k | } else { |
135 | 1.39k | col.get_data().push_back(this->get_pop_result()); |
136 | 1.39k | } |
137 | 1.39k | } _ZNK5doris7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 130 | 707 | void insert_result_into(IColumn& to) const { | 131 | 707 | auto& col = assert_cast<ColVecResult&>(to); | 132 | | if constexpr (is_decimal(T)) { | 133 | | col.get_data().push_back(this->get_pop_result().value()); | 134 | 707 | } else { | 135 | 707 | col.get_data().push_back(this->get_pop_result()); | 136 | 707 | } | 137 | 707 | } |
_ZNK5doris7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 130 | 686 | void insert_result_into(IColumn& to) const { | 131 | 686 | auto& col = assert_cast<ColVecResult&>(to); | 132 | | if constexpr (is_decimal(T)) { | 133 | | col.get_data().push_back(this->get_pop_result().value()); | 134 | 686 | } else { | 135 | 686 | col.get_data().push_back(this->get_pop_result()); | 136 | 686 | } | 137 | 686 | } |
|
138 | | |
139 | 1.13k | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); }_ZN5doris7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EE15get_return_typeEv Line | Count | Source | 139 | 608 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
_ZN5doris7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EE15get_return_typeEv Line | Count | Source | 139 | 524 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
|
140 | | }; |
141 | | |
142 | | // For this series of functions, the Decimal type is not supported |
143 | | // because the operations involve squaring, |
144 | | // which can easily exceed the range of the Decimal type. |
145 | | |
146 | | template <PrimitiveType T, typename Name, bool is_stddev> |
147 | | struct SampData : BaseData<T, is_stddev>, Name { |
148 | | using ColVecResult = std::conditional_t<is_decimal(T), ColumnDecimal128V2, ColumnFloat64>; |
149 | 1.32k | void insert_result_into(IColumn& to) const { |
150 | 1.32k | auto& col = assert_cast<ColVecResult&>(to); |
151 | 1.32k | if (this->count == 1 || this->count == 0) { |
152 | 525 | col.insert_default(); |
153 | 800 | } else { |
154 | | if constexpr (is_decimal(T)) { |
155 | | col.get_data().push_back(this->get_samp_result().value()); |
156 | 800 | } else { |
157 | 800 | col.get_data().push_back(this->get_samp_result()); |
158 | 800 | } |
159 | 800 | } |
160 | 1.32k | } _ZNK5doris8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 149 | 673 | void insert_result_into(IColumn& to) const { | 150 | 673 | auto& col = assert_cast<ColVecResult&>(to); | 151 | 673 | if (this->count == 1 || this->count == 0) { | 152 | 265 | col.insert_default(); | 153 | 408 | } else { | 154 | | if constexpr (is_decimal(T)) { | 155 | | col.get_data().push_back(this->get_samp_result().value()); | 156 | 408 | } else { | 157 | 408 | col.get_data().push_back(this->get_samp_result()); | 158 | 408 | } | 159 | 408 | } | 160 | 673 | } |
_ZNK5doris8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 149 | 652 | void insert_result_into(IColumn& to) const { | 150 | 652 | auto& col = assert_cast<ColVecResult&>(to); | 151 | 652 | if (this->count == 1 || this->count == 0) { | 152 | 260 | col.insert_default(); | 153 | 392 | } else { | 154 | | if constexpr (is_decimal(T)) { | 155 | | col.get_data().push_back(this->get_samp_result().value()); | 156 | 392 | } else { | 157 | 392 | col.get_data().push_back(this->get_samp_result()); | 158 | 392 | } | 159 | 392 | } | 160 | 652 | } |
|
161 | | |
162 | 977 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); }_ZN5doris8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EE15get_return_typeEv Line | Count | Source | 162 | 498 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
_ZN5doris8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EE15get_return_typeEv Line | Count | Source | 162 | 479 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
|
163 | | }; |
164 | | |
165 | | struct StddevName { |
166 | 192 | static const char* name() { return "stddev"; } |
167 | | }; |
168 | | struct VarianceName { |
169 | 189 | static const char* name() { return "variance"; } |
170 | | }; |
171 | | struct VarianceSampName { |
172 | 192 | static const char* name() { return "variance_samp"; } |
173 | | }; |
174 | | struct StddevSampName { |
175 | 169 | static const char* name() { return "stddev_samp"; } |
176 | | }; |
177 | | |
178 | | template <typename Data> |
179 | | class AggregateFunctionSampVariance |
180 | | : public IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>, |
181 | | UnaryExpression, |
182 | | NullableAggregateFunction { |
183 | | public: |
184 | | AggregateFunctionSampVariance(const DataTypes& argument_types_) |
185 | 3.91k | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( |
186 | 3.91k | argument_types_) {}_ZN5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 185 | 1.07k | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 186 | 1.07k | argument_types_) {} |
_ZN5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 185 | 1.13k | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 186 | 1.13k | argument_types_) {} |
_ZN5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 185 | 1.08k | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 186 | 1.08k | argument_types_) {} |
_ZN5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 185 | 615 | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 186 | 615 | argument_types_) {} |
|
187 | | |
188 | 742 | String get_name() const override { return Data::name(); }_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE8get_nameB5cxx11Ev Line | Count | Source | 188 | 192 | String get_name() const override { return Data::name(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE8get_nameB5cxx11Ev Line | Count | Source | 188 | 189 | String get_name() const override { return Data::name(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE8get_nameB5cxx11Ev Line | Count | Source | 188 | 192 | String get_name() const override { return Data::name(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE8get_nameB5cxx11Ev Line | Count | Source | 188 | 169 | String get_name() const override { return Data::name(); } |
|
189 | | |
190 | 2.10k | DataTypePtr get_return_type() const override { return Data::get_return_type(); }_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE15get_return_typeEv Line | Count | Source | 190 | 498 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE15get_return_typeEv Line | Count | Source | 190 | 608 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE15get_return_typeEv Line | Count | Source | 190 | 524 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE15get_return_typeEv Line | Count | Source | 190 | 479 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
|
191 | | |
192 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
193 | 7.20k | Arena&) const override { |
194 | 7.20k | this->data(place).add(columns[0], row_num); |
195 | 7.20k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 193 | 1.72k | Arena&) const override { | 194 | 1.72k | this->data(place).add(columns[0], row_num); | 195 | 1.72k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 193 | 1.98k | Arena&) const override { | 194 | 1.98k | this->data(place).add(columns[0], row_num); | 195 | 1.98k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 193 | 1.81k | Arena&) const override { | 194 | 1.81k | this->data(place).add(columns[0], row_num); | 195 | 1.81k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 193 | 1.67k | Arena&) const override { | 194 | 1.67k | this->data(place).add(columns[0], row_num); | 195 | 1.67k | } |
|
196 | | |
197 | 1.05k | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); }_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE5resetEPc Line | Count | Source | 197 | 271 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE5resetEPc Line | Count | Source | 197 | 271 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE5resetEPc Line | Count | Source | 197 | 269 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE5resetEPc Line | Count | Source | 197 | 245 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
|
198 | | |
199 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
200 | 3.78k | Arena&) const override { |
201 | 3.78k | this->data(place).merge(this->data(rhs)); |
202 | 3.78k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 200 | 928 | Arena&) const override { | 201 | 928 | this->data(place).merge(this->data(rhs)); | 202 | 928 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 200 | 1.09k | Arena&) const override { | 201 | 1.09k | this->data(place).merge(this->data(rhs)); | 202 | 1.09k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 200 | 955 | Arena&) const override { | 201 | 955 | this->data(place).merge(this->data(rhs)); | 202 | 955 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 200 | 802 | Arena&) const override { | 201 | 802 | this->data(place).merge(this->data(rhs)); | 202 | 802 | } |
|
203 | | |
204 | 3.90k | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
205 | 3.90k | this->data(place).write(buf); |
206 | 3.90k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 204 | 953 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 205 | 953 | this->data(place).write(buf); | 206 | 953 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 204 | 1.12k | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 205 | 1.12k | this->data(place).write(buf); | 206 | 1.12k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 204 | 981 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 205 | 981 | this->data(place).write(buf); | 206 | 981 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 204 | 849 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 205 | 849 | this->data(place).write(buf); | 206 | 849 | } |
|
207 | | |
208 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
209 | 3.78k | Arena&) const override { |
210 | 3.78k | this->data(place).read(buf); |
211 | 3.78k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 209 | 928 | Arena&) const override { | 210 | 928 | this->data(place).read(buf); | 211 | 928 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 209 | 1.09k | Arena&) const override { | 210 | 1.09k | this->data(place).read(buf); | 211 | 1.09k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 209 | 955 | Arena&) const override { | 210 | 955 | this->data(place).read(buf); | 211 | 955 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 209 | 802 | Arena&) const override { | 210 | 802 | this->data(place).read(buf); | 211 | 802 | } |
|
212 | | |
213 | 2.71k | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
214 | 2.71k | this->data(place).insert_result_into(to); |
215 | 2.71k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 213 | 673 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 214 | 673 | this->data(place).insert_result_into(to); | 215 | 673 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 213 | 707 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 214 | 707 | this->data(place).insert_result_into(to); | 215 | 707 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 213 | 686 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 214 | 686 | this->data(place).insert_result_into(to); | 215 | 686 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 213 | 652 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 214 | 652 | this->data(place).insert_result_into(to); | 215 | 652 | } |
|
216 | | }; |
217 | | |
218 | | } // namespace doris |
219 | | |
220 | | #include "common/compile_check_end.h" |