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 <limits> |
25 | | #include <memory> |
26 | | |
27 | | #include "core/assert_cast.h" |
28 | | #include "core/column/column.h" |
29 | | #include "core/data_type/data_type_number.h" |
30 | | #include "core/types.h" |
31 | | #include "exprs/aggregate/aggregate_function.h" |
32 | | |
33 | | namespace doris { |
34 | | class Arena; |
35 | | class BufferReadable; |
36 | | class BufferWritable; |
37 | | template <PrimitiveType T> |
38 | | class ColumnVector; |
39 | | |
40 | | template <PrimitiveType T, bool is_stddev> |
41 | | struct BaseData { |
42 | 8.73k | BaseData() = default; _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EEC2Ev Line | Count | Source | 42 | 4.56k | BaseData() = default; |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EEC2Ev Line | Count | Source | 42 | 4.17k | BaseData() = default; |
|
43 | 8.72k | virtual ~BaseData() = default; _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EED2Ev Line | Count | Source | 43 | 4.55k | virtual ~BaseData() = default; |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EED2Ev Line | Count | Source | 43 | 4.16k | virtual ~BaseData() = default; |
|
44 | | |
45 | 3.33k | void write(BufferWritable& buf) const { |
46 | 3.33k | buf.write_binary(mean); |
47 | 3.33k | buf.write_binary(m2); |
48 | 3.33k | buf.write_binary(count); |
49 | 3.33k | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE5writeERNS_14BufferWritableE Line | Count | Source | 45 | 1.76k | void write(BufferWritable& buf) const { | 46 | 1.76k | buf.write_binary(mean); | 47 | 1.76k | buf.write_binary(m2); | 48 | 1.76k | buf.write_binary(count); | 49 | 1.76k | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE5writeERNS_14BufferWritableE Line | Count | Source | 45 | 1.57k | void write(BufferWritable& buf) const { | 46 | 1.57k | buf.write_binary(mean); | 47 | 1.57k | buf.write_binary(m2); | 48 | 1.57k | buf.write_binary(count); | 49 | 1.57k | } |
|
50 | | |
51 | 3.21k | void read(BufferReadable& buf) { |
52 | 3.21k | buf.read_binary(mean); |
53 | 3.21k | buf.read_binary(m2); |
54 | 3.21k | buf.read_binary(count); |
55 | 3.21k | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE4readERNS_14BufferReadableE Line | Count | Source | 51 | 1.70k | void read(BufferReadable& buf) { | 52 | 1.70k | buf.read_binary(mean); | 53 | 1.70k | buf.read_binary(m2); | 54 | 1.70k | buf.read_binary(count); | 55 | 1.70k | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE4readERNS_14BufferReadableE Line | Count | Source | 51 | 1.50k | void read(BufferReadable& buf) { | 52 | 1.50k | buf.read_binary(mean); | 53 | 1.50k | buf.read_binary(m2); | 54 | 1.50k | buf.read_binary(count); | 55 | 1.50k | } |
|
56 | | |
57 | 841 | void reset() { |
58 | 841 | mean = 0.0; |
59 | 841 | m2 = 0.0; |
60 | 841 | count = 0; |
61 | 841 | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE5resetEv Line | Count | Source | 57 | 434 | void reset() { | 58 | 434 | mean = 0.0; | 59 | 434 | m2 = 0.0; | 60 | 434 | count = 0; | 61 | 434 | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE5resetEv Line | Count | Source | 57 | 407 | void reset() { | 58 | 407 | mean = 0.0; | 59 | 407 | m2 = 0.0; | 60 | 407 | count = 0; | 61 | 407 | } |
|
62 | | |
63 | 1.34k | double get_result(double res) const { |
64 | 1.34k | auto inf_to_nan = [](double val) { |
65 | | // This function performs squaring operations, and due to differences in computation order, |
66 | | // it might produce different values such as inf and nan. |
67 | | // In MySQL, this will directly result in an error due to exceeding the double range. |
68 | | // For performance reasons, we are uniformly changing it to nan |
69 | 1.34k | if (std::isinf(val)) { |
70 | 0 | return std::numeric_limits<double>::quiet_NaN(); |
71 | 0 | } |
72 | 1.34k | return val; |
73 | 1.34k | }; _ZZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE10get_resultEdENKUldE_clEd Line | Count | Source | 64 | 685 | auto inf_to_nan = [](double val) { | 65 | | // This function performs squaring operations, and due to differences in computation order, | 66 | | // it might produce different values such as inf and nan. | 67 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 68 | | // For performance reasons, we are uniformly changing it to nan | 69 | 685 | if (std::isinf(val)) { | 70 | 0 | return std::numeric_limits<double>::quiet_NaN(); | 71 | 0 | } | 72 | 685 | return val; | 73 | 685 | }; |
_ZZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE10get_resultEdENKUldE_clEd Line | Count | Source | 64 | 662 | auto inf_to_nan = [](double val) { | 65 | | // This function performs squaring operations, and due to differences in computation order, | 66 | | // it might produce different values such as inf and nan. | 67 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 68 | | // For performance reasons, we are uniformly changing it to nan | 69 | 662 | if (std::isinf(val)) { | 70 | 0 | return std::numeric_limits<double>::quiet_NaN(); | 71 | 0 | } | 72 | 662 | return val; | 73 | 662 | }; |
|
74 | 1.34k | if constexpr (is_stddev) { |
75 | 662 | return inf_to_nan(std::sqrt(res)); |
76 | 685 | } else { |
77 | 685 | return inf_to_nan(res); |
78 | 685 | } |
79 | 1.34k | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE10get_resultEd Line | Count | Source | 63 | 685 | double get_result(double res) const { | 64 | 685 | auto inf_to_nan = [](double val) { | 65 | | // This function performs squaring operations, and due to differences in computation order, | 66 | | // it might produce different values such as inf and nan. | 67 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 68 | | // For performance reasons, we are uniformly changing it to nan | 69 | 685 | if (std::isinf(val)) { | 70 | 685 | return std::numeric_limits<double>::quiet_NaN(); | 71 | 685 | } | 72 | 685 | return val; | 73 | 685 | }; | 74 | | if constexpr (is_stddev) { | 75 | | return inf_to_nan(std::sqrt(res)); | 76 | 685 | } else { | 77 | 685 | return inf_to_nan(res); | 78 | 685 | } | 79 | 685 | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE10get_resultEd Line | Count | Source | 63 | 662 | double get_result(double res) const { | 64 | 662 | auto inf_to_nan = [](double val) { | 65 | | // This function performs squaring operations, and due to differences in computation order, | 66 | | // it might produce different values such as inf and nan. | 67 | | // In MySQL, this will directly result in an error due to exceeding the double range. | 68 | | // For performance reasons, we are uniformly changing it to nan | 69 | 662 | if (std::isinf(val)) { | 70 | 662 | return std::numeric_limits<double>::quiet_NaN(); | 71 | 662 | } | 72 | 662 | return val; | 73 | 662 | }; | 74 | 662 | if constexpr (is_stddev) { | 75 | 662 | return inf_to_nan(std::sqrt(res)); | 76 | | } else { | 77 | | return inf_to_nan(res); | 78 | | } | 79 | 662 | } |
|
80 | | |
81 | 1.18k | double get_pop_result() const { |
82 | 1.18k | if (count == 1) { |
83 | 484 | return 0.0; |
84 | 484 | } |
85 | 702 | double res = m2 / (double)count; |
86 | 702 | return get_result(res); |
87 | 1.18k | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE14get_pop_resultEv Line | Count | Source | 81 | 598 | double get_pop_result() const { | 82 | 598 | if (count == 1) { | 83 | 242 | return 0.0; | 84 | 242 | } | 85 | 356 | double res = m2 / (double)count; | 86 | 356 | return get_result(res); | 87 | 598 | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE14get_pop_resultEv Line | Count | Source | 81 | 588 | double get_pop_result() const { | 82 | 588 | if (count == 1) { | 83 | 242 | return 0.0; | 84 | 242 | } | 85 | 346 | double res = m2 / (double)count; | 86 | 346 | return get_result(res); | 87 | 588 | } |
|
88 | | |
89 | 645 | double get_samp_result() const { |
90 | 645 | double res = m2 / double(count - 1); |
91 | 645 | return get_result(res); |
92 | 645 | } _ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE15get_samp_resultEv Line | Count | Source | 89 | 329 | double get_samp_result() const { | 90 | 329 | double res = m2 / double(count - 1); | 91 | 329 | return get_result(res); | 92 | 329 | } |
_ZNK5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE15get_samp_resultEv Line | Count | Source | 89 | 316 | double get_samp_result() const { | 90 | 316 | double res = m2 / double(count - 1); | 91 | 316 | return get_result(res); | 92 | 316 | } |
|
93 | | |
94 | 3.21k | void merge(const BaseData& rhs) { |
95 | 3.21k | if (rhs.count == 0) { |
96 | 92 | return; |
97 | 92 | } |
98 | 3.12k | double delta = mean - rhs.mean; |
99 | 3.12k | double sum_count = double(count + rhs.count); |
100 | 3.12k | mean = rhs.mean + delta * (double)count / sum_count; |
101 | 3.12k | m2 = rhs.m2 + m2 + (delta * delta) * (double)rhs.count * (double)count / sum_count; |
102 | 3.12k | count = int64_t(sum_count); |
103 | 3.12k | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE5mergeERKS2_ Line | Count | Source | 94 | 1.71k | void merge(const BaseData& rhs) { | 95 | 1.71k | if (rhs.count == 0) { | 96 | 47 | return; | 97 | 47 | } | 98 | 1.66k | double delta = mean - rhs.mean; | 99 | 1.66k | double sum_count = double(count + rhs.count); | 100 | 1.66k | mean = rhs.mean + delta * (double)count / sum_count; | 101 | 1.66k | m2 = rhs.m2 + m2 + (delta * delta) * (double)rhs.count * (double)count / sum_count; | 102 | 1.66k | count = int64_t(sum_count); | 103 | 1.66k | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE5mergeERKS2_ Line | Count | Source | 94 | 1.50k | void merge(const BaseData& rhs) { | 95 | 1.50k | if (rhs.count == 0) { | 96 | 45 | return; | 97 | 45 | } | 98 | 1.45k | double delta = mean - rhs.mean; | 99 | 1.45k | double sum_count = double(count + rhs.count); | 100 | 1.45k | mean = rhs.mean + delta * (double)count / sum_count; | 101 | 1.45k | m2 = rhs.m2 + m2 + (delta * delta) * (double)rhs.count * (double)count / sum_count; | 102 | 1.45k | count = int64_t(sum_count); | 103 | 1.45k | } |
|
104 | | |
105 | 6.20k | void add(const IColumn* column, size_t row_num) { |
106 | 6.20k | const auto& sources = assert_cast<const typename PrimitiveTypeTraits<T>::ColumnType&, |
107 | 6.20k | TypeCheckOnRelease::DISABLE>(*column); |
108 | 6.20k | double source_data = (double)sources.get_data()[row_num]; |
109 | | |
110 | 6.20k | double delta = source_data - mean; |
111 | 6.20k | double r = delta / double(1 + count); |
112 | 6.20k | mean += r; |
113 | 6.20k | m2 += (double)count * delta * r; |
114 | 6.20k | count += 1; |
115 | 6.20k | } _ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb0EE3addEPKNS_7IColumnEm Line | Count | Source | 105 | 3.14k | void add(const IColumn* column, size_t row_num) { | 106 | 3.14k | const auto& sources = assert_cast<const typename PrimitiveTypeTraits<T>::ColumnType&, | 107 | 3.14k | TypeCheckOnRelease::DISABLE>(*column); | 108 | 3.14k | double source_data = (double)sources.get_data()[row_num]; | 109 | | | 110 | 3.14k | double delta = source_data - mean; | 111 | 3.14k | double r = delta / double(1 + count); | 112 | 3.14k | mean += r; | 113 | 3.14k | m2 += (double)count * delta * r; | 114 | 3.14k | count += 1; | 115 | 3.14k | } |
_ZN5doris8BaseDataILNS_13PrimitiveTypeE9ELb1EE3addEPKNS_7IColumnEm Line | Count | Source | 105 | 3.06k | void add(const IColumn* column, size_t row_num) { | 106 | 3.06k | const auto& sources = assert_cast<const typename PrimitiveTypeTraits<T>::ColumnType&, | 107 | 3.06k | TypeCheckOnRelease::DISABLE>(*column); | 108 | 3.06k | double source_data = (double)sources.get_data()[row_num]; | 109 | | | 110 | 3.06k | double delta = source_data - mean; | 111 | 3.06k | double r = delta / double(1 + count); | 112 | 3.06k | mean += r; | 113 | 3.06k | m2 += (double)count * delta * r; | 114 | 3.06k | count += 1; | 115 | 3.06k | } |
|
116 | | |
117 | | double mean {}; |
118 | | double m2 {}; |
119 | | int64_t count {}; |
120 | | }; |
121 | | |
122 | | template <PrimitiveType T, typename Name, bool is_stddev> |
123 | | struct PopData : BaseData<T, is_stddev>, Name { |
124 | 1.18k | void insert_result_into(IColumn& to) const { |
125 | 1.18k | auto& col = assert_cast<ColumnFloat64&>(to); |
126 | 1.18k | col.get_data().push_back(this->get_pop_result()); |
127 | 1.18k | } _ZNK5doris7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 124 | 598 | void insert_result_into(IColumn& to) const { | 125 | 598 | auto& col = assert_cast<ColumnFloat64&>(to); | 126 | 598 | col.get_data().push_back(this->get_pop_result()); | 127 | 598 | } |
_ZNK5doris7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 124 | 588 | void insert_result_into(IColumn& to) const { | 125 | 588 | auto& col = assert_cast<ColumnFloat64&>(to); | 126 | 588 | col.get_data().push_back(this->get_pop_result()); | 127 | 588 | } |
|
128 | | |
129 | 1.07k | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); }_ZN5doris7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EE15get_return_typeEv Line | Count | Source | 129 | 559 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
_ZN5doris7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EE15get_return_typeEv Line | Count | Source | 129 | 512 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
|
130 | | }; |
131 | | |
132 | | // For this series of functions, the Decimal type is not supported |
133 | | // because the operations involve squaring, |
134 | | // which can easily exceed the range of the Decimal type. |
135 | | |
136 | | template <PrimitiveType T, typename Name, bool is_stddev> |
137 | | struct SampData : BaseData<T, is_stddev>, Name { |
138 | 1.13k | void insert_result_into(IColumn& to) const { |
139 | 1.13k | auto& col = assert_cast<ColumnFloat64&>(to); |
140 | 1.13k | if (this->count == 1 || this->count == 0) { |
141 | 487 | col.get_data().push_back(std::numeric_limits<double>::quiet_NaN()); |
142 | 645 | } else { |
143 | 645 | col.get_data().push_back(this->get_samp_result()); |
144 | 645 | } |
145 | 1.13k | } _ZNK5doris8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 138 | 575 | void insert_result_into(IColumn& to) const { | 139 | 575 | auto& col = assert_cast<ColumnFloat64&>(to); | 140 | 575 | if (this->count == 1 || this->count == 0) { | 141 | 246 | col.get_data().push_back(std::numeric_limits<double>::quiet_NaN()); | 142 | 329 | } else { | 143 | 329 | col.get_data().push_back(this->get_samp_result()); | 144 | 329 | } | 145 | 575 | } |
_ZNK5doris8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 138 | 557 | void insert_result_into(IColumn& to) const { | 139 | 557 | auto& col = assert_cast<ColumnFloat64&>(to); | 140 | 557 | if (this->count == 1 || this->count == 0) { | 141 | 241 | col.get_data().push_back(std::numeric_limits<double>::quiet_NaN()); | 142 | 316 | } else { | 143 | 316 | col.get_data().push_back(this->get_samp_result()); | 144 | 316 | } | 145 | 557 | } |
|
146 | | |
147 | 956 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); }_ZN5doris8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EE15get_return_typeEv Line | Count | Source | 147 | 488 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
_ZN5doris8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EE15get_return_typeEv Line | Count | Source | 147 | 468 | static DataTypePtr get_return_type() { return std::make_shared<DataTypeFloat64>(); } |
|
148 | | }; |
149 | | |
150 | | struct StddevName { |
151 | 209 | static const char* name() { return "stddev"; } |
152 | | }; |
153 | | struct VarianceName { |
154 | 211 | static const char* name() { return "variance"; } |
155 | | }; |
156 | | struct VarianceSampName { |
157 | 209 | static const char* name() { return "variance_samp"; } |
158 | | }; |
159 | | struct StddevSampName { |
160 | 184 | static const char* name() { return "stddev_samp"; } |
161 | | }; |
162 | | |
163 | | template <typename Data> |
164 | | class AggregateFunctionSampVariance final |
165 | | : public IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>, |
166 | | UnaryExpression, |
167 | | NullableAggregateFunction { |
168 | | public: |
169 | | AggregateFunctionSampVariance(const DataTypes& argument_types_) |
170 | 3.05k | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( |
171 | 3.05k | argument_types_) {}_ZN5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 170 | 839 | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 171 | 839 | argument_types_) {} |
_ZN5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 170 | 878 | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 171 | 878 | argument_types_) {} |
_ZN5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 170 | 850 | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 171 | 850 | argument_types_) {} |
_ZN5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISA_EE Line | Count | Source | 170 | 487 | : IAggregateFunctionDataHelper<Data, AggregateFunctionSampVariance<Data>>( | 171 | 487 | argument_types_) {} |
|
172 | | |
173 | 811 | String get_name() const override { return Data::name(); }_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE8get_nameB5cxx11Ev Line | Count | Source | 173 | 209 | String get_name() const override { return Data::name(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE8get_nameB5cxx11Ev Line | Count | Source | 173 | 210 | String get_name() const override { return Data::name(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE8get_nameB5cxx11Ev Line | Count | Source | 173 | 208 | String get_name() const override { return Data::name(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE8get_nameB5cxx11Ev Line | Count | Source | 173 | 184 | String get_name() const override { return Data::name(); } |
|
174 | | |
175 | 2.02k | DataTypePtr get_return_type() const override { return Data::get_return_type(); }_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE15get_return_typeEv Line | Count | Source | 175 | 488 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE15get_return_typeEv Line | Count | Source | 175 | 559 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE15get_return_typeEv Line | Count | Source | 175 | 512 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE15get_return_typeEv Line | Count | Source | 175 | 468 | DataTypePtr get_return_type() const override { return Data::get_return_type(); } |
|
176 | | |
177 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
178 | 6.20k | Arena&) const override { |
179 | 6.20k | this->data(place).add(columns[0], row_num); |
180 | 6.20k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 178 | 1.48k | Arena&) const override { | 179 | 1.48k | this->data(place).add(columns[0], row_num); | 180 | 1.48k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 178 | 1.65k | Arena&) const override { | 179 | 1.65k | this->data(place).add(columns[0], row_num); | 180 | 1.65k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 178 | 1.62k | Arena&) const override { | 179 | 1.62k | this->data(place).add(columns[0], row_num); | 180 | 1.62k | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 178 | 1.44k | Arena&) const override { | 179 | 1.44k | this->data(place).add(columns[0], row_num); | 180 | 1.44k | } |
|
181 | | |
182 | 842 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); }_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE5resetEPc Line | Count | Source | 182 | 217 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE5resetEPc Line | Count | Source | 182 | 217 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE5resetEPc Line | Count | Source | 182 | 217 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE5resetEPc Line | Count | Source | 182 | 191 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
|
183 | | |
184 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
185 | 3.21k | Arena&) const override { |
186 | 3.21k | this->data(place).merge(this->data(rhs)); |
187 | 3.21k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 185 | 804 | Arena&) const override { | 186 | 804 | this->data(place).merge(this->data(rhs)); | 187 | 804 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 185 | 906 | Arena&) const override { | 186 | 906 | this->data(place).merge(this->data(rhs)); | 187 | 906 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 185 | 824 | Arena&) const override { | 186 | 824 | this->data(place).merge(this->data(rhs)); | 187 | 824 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 185 | 679 | Arena&) const override { | 186 | 679 | this->data(place).merge(this->data(rhs)); | 187 | 679 | } |
|
188 | | |
189 | 3.33k | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
190 | 3.33k | this->data(place).write(buf); |
191 | 3.33k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 189 | 829 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 190 | 829 | this->data(place).write(buf); | 191 | 829 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 189 | 932 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 190 | 932 | this->data(place).write(buf); | 191 | 932 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 189 | 849 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 190 | 849 | this->data(place).write(buf); | 191 | 849 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 189 | 727 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 190 | 727 | this->data(place).write(buf); | 191 | 727 | } |
|
192 | | |
193 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
194 | 3.21k | Arena&) const override { |
195 | 3.21k | this->data(place).read(buf); |
196 | 3.21k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 194 | 803 | Arena&) const override { | 195 | 803 | this->data(place).read(buf); | 196 | 803 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 194 | 906 | Arena&) const override { | 195 | 906 | this->data(place).read(buf); | 196 | 906 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 194 | 822 | Arena&) const override { | 195 | 822 | this->data(place).read(buf); | 196 | 822 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 194 | 679 | Arena&) const override { | 195 | 679 | this->data(place).read(buf); | 196 | 679 | } |
|
197 | | |
198 | 2.31k | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
199 | 2.31k | this->data(place).insert_result_into(to); |
200 | 2.31k | } _ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_16VarianceSampNameELb0EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 198 | 575 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 199 | 575 | this->data(place).insert_result_into(to); | 200 | 575 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_12VarianceNameELb0EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 198 | 598 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 199 | 598 | this->data(place).insert_result_into(to); | 200 | 598 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_7PopDataILNS_13PrimitiveTypeE9ENS_10StddevNameELb1EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 198 | 588 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 199 | 588 | this->data(place).insert_result_into(to); | 200 | 588 | } |
_ZNK5doris29AggregateFunctionSampVarianceINS_8SampDataILNS_13PrimitiveTypeE9ENS_14StddevSampNameELb1EEEE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 198 | 557 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 199 | 557 | this->data(place).insert_result_into(to); | 200 | 557 | } |
|
201 | | }; |
202 | | |
203 | | } // namespace doris |