be/src/exprs/aggregate/aggregate_function_percentile.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 <glog/logging.h> |
21 | | #include <stddef.h> |
22 | | #include <stdint.h> |
23 | | |
24 | | #include <boost/iterator/iterator_facade.hpp> |
25 | | #include <cmath> |
26 | | #include <cstdint> |
27 | | #include <memory> |
28 | | #include <string> |
29 | | #include <vector> |
30 | | |
31 | | #include "core/assert_cast.h" |
32 | | #include "core/column/column.h" |
33 | | #include "core/column/column_array.h" |
34 | | #include "core/column/column_nullable.h" |
35 | | #include "core/column/column_vector.h" |
36 | | #include "core/data_type/data_type_array.h" |
37 | | #include "core/data_type/data_type_nullable.h" |
38 | | #include "core/data_type/data_type_number.h" |
39 | | #include "core/pod_array.h" |
40 | | #include "core/pod_array_fwd.h" |
41 | | #include "core/types.h" |
42 | | #include "exprs/aggregate/aggregate_function.h" |
43 | | #include "util/percentile_util.h" |
44 | | #include "util/tdigest.h" |
45 | | |
46 | | namespace doris { |
47 | | |
48 | | class Arena; |
49 | | class BufferReadable; |
50 | | |
51 | | inline void check_percentile_array_column_type(const IAggregateFunction& function, |
52 | 205 | const IColumn& column, size_t index) { |
53 | 205 | const auto* array_column = check_and_get_column<ColumnArray>(column); |
54 | 205 | if (UNLIKELY(array_column == nullptr)) { |
55 | 0 | throw doris::Exception(Status::InternalError( |
56 | 0 | "Aggregate function {} argument {} type check failed: Column type {} is not " |
57 | 0 | "ColumnArray", |
58 | 0 | function.get_name(), index, column.get_name())); |
59 | 0 | } |
60 | | |
61 | 205 | const auto* nullable_column = check_and_get_column<ColumnNullable>(array_column->get_data()); |
62 | 205 | if (UNLIKELY(nullable_column == nullptr)) { |
63 | 0 | throw doris::Exception(Status::InternalError( |
64 | 0 | "Aggregate function {} argument {} type check failed: Array nested column type {} " |
65 | 0 | "is not ColumnNullable", |
66 | 0 | function.get_name(), index, array_column->get_data().get_name())); |
67 | 0 | } |
68 | | |
69 | 205 | if (UNLIKELY(check_and_get_column<ColumnFloat64>(nullable_column->get_nested_column()) == |
70 | 205 | nullptr)) { |
71 | 0 | throw doris::Exception(Status::InternalError( |
72 | 0 | "Aggregate function {} argument {} type check failed: Array nested data column " |
73 | 0 | "type {} is not ColumnFloat64", |
74 | 0 | function.get_name(), index, nullable_column->get_nested_column().get_name())); |
75 | 0 | } |
76 | 205 | } |
77 | | |
78 | | struct PercentileApproxState { |
79 | | static constexpr double INIT_QUANTILE = -1.0; |
80 | 1.09k | PercentileApproxState() = default; |
81 | 1.08k | ~PercentileApproxState() = default; |
82 | | |
83 | 954 | void init(double quantile, float compression = 10000) { |
84 | 954 | if (!init_flag) { |
85 | | //https://doris.apache.org/zh-CN/sql-reference/sql-functions/aggregate-functions/percentile_approx.html#description |
86 | | //The compression parameter setting range is [2048, 10000]. |
87 | | //If the value of compression parameter is not specified set, or is outside the range of [2048, 10000], |
88 | | //will use the default value of 10000 |
89 | 468 | if (!std::isfinite(compression) || compression < 2048 || compression > 10000) { |
90 | 0 | compression = 10000; |
91 | 0 | } |
92 | 468 | digest = TDigest::create_unique(compression); |
93 | 468 | check_quantile(quantile); |
94 | 468 | target_quantile = quantile; |
95 | 468 | compressions = compression; |
96 | 468 | init_flag = true; |
97 | 468 | } |
98 | 954 | } |
99 | | |
100 | 336 | void write(BufferWritable& buf) const { |
101 | 336 | buf.write_binary(init_flag); |
102 | 336 | if (!init_flag) { |
103 | 0 | return; |
104 | 0 | } |
105 | | |
106 | 336 | buf.write_binary(target_quantile); |
107 | 336 | buf.write_binary(compressions); |
108 | 336 | uint32_t serialize_size = digest->serialized_size(); |
109 | 336 | std::string result(serialize_size, '0'); |
110 | 336 | DCHECK(digest.get() != nullptr); |
111 | 336 | digest->serialize((uint8_t*)result.c_str()); |
112 | | |
113 | 336 | buf.write_binary(result); |
114 | 336 | } |
115 | | |
116 | 297 | void read(BufferReadable& buf) { |
117 | 297 | buf.read_binary(init_flag); |
118 | 297 | if (!init_flag) { |
119 | 0 | return; |
120 | 0 | } |
121 | | |
122 | 297 | buf.read_binary(target_quantile); |
123 | 297 | buf.read_binary(compressions); |
124 | 297 | std::string str; |
125 | 297 | buf.read_binary(str); |
126 | 297 | digest = TDigest::create_unique(compressions); |
127 | 297 | digest->unserialize((uint8_t*)str.c_str()); |
128 | 297 | } |
129 | | |
130 | 385 | double get() const { |
131 | 385 | if (init_flag) { |
132 | 383 | return digest->quantile(static_cast<float>(target_quantile)); |
133 | 383 | } else { |
134 | 2 | return std::nan(""); |
135 | 2 | } |
136 | 385 | } |
137 | | |
138 | 297 | void merge(const PercentileApproxState& rhs) { |
139 | 297 | if (!rhs.init_flag) { |
140 | 0 | return; |
141 | 0 | } |
142 | 297 | if (init_flag) { |
143 | 145 | DCHECK(digest.get() != nullptr); |
144 | 145 | digest->merge(rhs.digest.get()); |
145 | 152 | } else { |
146 | 152 | digest = TDigest::create_unique(compressions); |
147 | 152 | digest->merge(rhs.digest.get()); |
148 | 152 | init_flag = true; |
149 | 152 | } |
150 | 297 | if (target_quantile == PercentileApproxState::INIT_QUANTILE) { |
151 | 152 | target_quantile = rhs.target_quantile; |
152 | 152 | } |
153 | 297 | } |
154 | | |
155 | 781 | void add(double source) { digest->add(static_cast<float>(source)); } |
156 | | |
157 | 167 | void add_with_weight(double source, double weight) { |
158 | | // the weight should be positive num, as have check the value valid use DCHECK_GT(c._weight, 0); |
159 | 167 | if (weight <= 0) { |
160 | 10 | return; |
161 | 10 | } |
162 | 157 | digest->add(static_cast<float>(source), static_cast<float>(weight)); |
163 | 157 | } |
164 | | |
165 | 154 | void reset() { |
166 | 154 | target_quantile = INIT_QUANTILE; |
167 | 154 | init_flag = false; |
168 | 154 | digest = TDigest::create_unique(compressions); |
169 | 154 | } |
170 | | |
171 | | bool init_flag = false; |
172 | | std::unique_ptr<TDigest> digest; |
173 | | double target_quantile = INIT_QUANTILE; |
174 | | float compressions = 10000; |
175 | | }; |
176 | | |
177 | | template <typename Derived> |
178 | | class AggregateFunctionPercentileApproxBase |
179 | | : public IAggregateFunctionDataHelper<PercentileApproxState, Derived> { |
180 | | public: |
181 | | AggregateFunctionPercentileApproxBase(const DataTypes& argument_types_) |
182 | 865 | : IAggregateFunctionDataHelper<PercentileApproxState, Derived>(argument_types_) {}_ZN5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 182 | 768 | : IAggregateFunctionDataHelper<PercentileApproxState, Derived>(argument_types_) {} |
_ZN5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 182 | 37 | : IAggregateFunctionDataHelper<PercentileApproxState, Derived>(argument_types_) {} |
_ZN5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 182 | 38 | : IAggregateFunctionDataHelper<PercentileApproxState, Derived>(argument_types_) {} |
_ZN5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 182 | 22 | : IAggregateFunctionDataHelper<PercentileApproxState, Derived>(argument_types_) {} |
|
183 | | |
184 | 93 | String get_name() const override { return "percentile_approx"; }_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE8get_nameB5cxx11Ev Line | Count | Source | 184 | 53 | String get_name() const override { return "percentile_approx"; } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE8get_nameB5cxx11Ev Line | Count | Source | 184 | 30 | String get_name() const override { return "percentile_approx"; } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE8get_nameB5cxx11Ev Line | Count | Source | 184 | 10 | String get_name() const override { return "percentile_approx"; } |
Unexecuted instantiation: _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE8get_nameB5cxx11Ev |
185 | | |
186 | 155 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); }_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE5resetEPc Line | Count | Source | 186 | 50 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE5resetEPc Line | Count | Source | 186 | 102 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE5resetEPc Line | Count | Source | 186 | 3 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
Unexecuted instantiation: _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE5resetEPc |
187 | | |
188 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
189 | 297 | Arena&) const override { |
190 | 297 | this->data(place).merge(this->data(rhs)); |
191 | 297 | } _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 189 | 213 | Arena&) const override { | 190 | 213 | this->data(place).merge(this->data(rhs)); | 191 | 213 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 189 | 64 | Arena&) const override { | 190 | 64 | this->data(place).merge(this->data(rhs)); | 191 | 64 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 189 | 10 | Arena&) const override { | 190 | 10 | this->data(place).merge(this->data(rhs)); | 191 | 10 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 189 | 10 | Arena&) const override { | 190 | 10 | this->data(place).merge(this->data(rhs)); | 191 | 10 | } |
|
192 | | |
193 | 336 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
194 | 336 | this->data(place).write(buf); |
195 | 336 | } _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 193 | 252 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 194 | 252 | this->data(place).write(buf); | 195 | 252 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 193 | 64 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 194 | 64 | this->data(place).write(buf); | 195 | 64 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 193 | 10 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 194 | 10 | this->data(place).write(buf); | 195 | 10 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 193 | 10 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 194 | 10 | this->data(place).write(buf); | 195 | 10 | } |
|
196 | | |
197 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
198 | 297 | Arena&) const override { |
199 | 297 | this->data(place).read(buf); |
200 | 297 | } _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 198 | 213 | Arena&) const override { | 199 | 213 | this->data(place).read(buf); | 200 | 213 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 198 | 64 | Arena&) const override { | 199 | 64 | this->data(place).read(buf); | 200 | 64 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 198 | 10 | Arena&) const override { | 199 | 10 | this->data(place).read(buf); | 200 | 10 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 198 | 10 | Arena&) const override { | 199 | 10 | this->data(place).read(buf); | 200 | 10 | } |
|
201 | | |
202 | 368 | void check_input_columns_type(const IColumn** columns) const override { |
203 | 1.37k | for (size_t i = 0; i < this->argument_types.size(); ++i) { |
204 | 1.01k | this->template check_argument_column_type<ColumnFloat64>(columns[i]); |
205 | 1.01k | } |
206 | 368 | } _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 202 | 102 | void check_input_columns_type(const IColumn** columns) const override { | 203 | 307 | for (size_t i = 0; i < this->argument_types.size(); ++i) { | 204 | 205 | this->template check_argument_column_type<ColumnFloat64>(columns[i]); | 205 | 205 | } | 206 | 102 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 202 | 238 | void check_input_columns_type(const IColumn** columns) const override { | 203 | 950 | for (size_t i = 0; i < this->argument_types.size(); ++i) { | 204 | 712 | this->template check_argument_column_type<ColumnFloat64>(columns[i]); | 205 | 712 | } | 206 | 238 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 202 | 18 | void check_input_columns_type(const IColumn** columns) const override { | 203 | 72 | for (size_t i = 0; i < this->argument_types.size(); ++i) { | 204 | 54 | this->template check_argument_column_type<ColumnFloat64>(columns[i]); | 205 | 54 | } | 206 | 18 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 202 | 10 | void check_input_columns_type(const IColumn** columns) const override { | 203 | 50 | for (size_t i = 0; i < this->argument_types.size(); ++i) { | 204 | 40 | this->template check_argument_column_type<ColumnFloat64>(columns[i]); | 205 | 40 | } | 206 | 10 | } |
|
207 | | }; |
208 | | |
209 | | class AggregateFunctionPercentileApproxTwoParams final |
210 | | : public AggregateFunctionPercentileApproxBase<AggregateFunctionPercentileApproxTwoParams>, |
211 | | public MultiExpression, |
212 | | public NullableAggregateFunction { |
213 | | public: |
214 | | AggregateFunctionPercentileApproxTwoParams(const DataTypes& argument_types_) |
215 | 768 | : AggregateFunctionPercentileApproxBase<AggregateFunctionPercentileApproxTwoParams>( |
216 | 768 | argument_types_) {} |
217 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
218 | 348 | Arena&) const override { |
219 | 348 | const auto& sources = |
220 | 348 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
221 | 348 | const auto& quantile = |
222 | 348 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
223 | 348 | this->data(place).init(quantile.get_element(0)); |
224 | 348 | this->data(place).add(sources.get_element(row_num)); |
225 | 348 | } |
226 | | |
227 | 368 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
228 | | |
229 | 115 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
230 | 115 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
231 | 115 | col.get_data().push_back(this->data(place).get()); |
232 | 115 | } |
233 | | }; |
234 | | |
235 | | class AggregateFunctionPercentileApproxThreeParams final |
236 | | : public AggregateFunctionPercentileApproxBase< |
237 | | AggregateFunctionPercentileApproxThreeParams>, |
238 | | public MultiExpression, |
239 | | public NullableAggregateFunction { |
240 | | public: |
241 | | AggregateFunctionPercentileApproxThreeParams(const DataTypes& argument_types_) |
242 | 37 | : AggregateFunctionPercentileApproxBase<AggregateFunctionPercentileApproxThreeParams>( |
243 | 37 | argument_types_) {} |
244 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
245 | 438 | Arena&) const override { |
246 | 438 | const auto& sources = |
247 | 438 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
248 | 438 | const auto& quantile = |
249 | 438 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
250 | 438 | const auto& compression = |
251 | 438 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); |
252 | | |
253 | 438 | this->data(place).init(quantile.get_element(0), |
254 | 438 | static_cast<float>(compression.get_element(0))); |
255 | 438 | this->data(place).add(sources.get_element(row_num)); |
256 | 438 | } |
257 | | |
258 | 518 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
259 | | |
260 | 224 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
261 | 224 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
262 | 224 | col.get_data().push_back(this->data(place).get()); |
263 | 224 | } |
264 | | }; |
265 | | |
266 | | class AggregateFunctionPercentileApproxWeightedThreeParams final |
267 | | : public AggregateFunctionPercentileApproxBase< |
268 | | AggregateFunctionPercentileApproxWeightedThreeParams>, |
269 | | MultiExpression, |
270 | | NullableAggregateFunction { |
271 | | public: |
272 | | AggregateFunctionPercentileApproxWeightedThreeParams(const DataTypes& argument_types_) |
273 | 38 | : AggregateFunctionPercentileApproxBase< |
274 | 38 | AggregateFunctionPercentileApproxWeightedThreeParams>(argument_types_) {} |
275 | | |
276 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
277 | 87 | Arena&) const override { |
278 | 87 | const auto& sources = |
279 | 87 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
280 | 87 | const auto& weight = |
281 | 87 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
282 | 87 | const auto& quantile = |
283 | 87 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); |
284 | | |
285 | 87 | this->data(place).init(quantile.get_element(0)); |
286 | 87 | this->data(place).add_with_weight(sources.get_element(row_num), |
287 | 87 | weight.get_element(row_num)); |
288 | 87 | } |
289 | | |
290 | 175 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
291 | | |
292 | 36 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
293 | 36 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
294 | 36 | col.get_data().push_back(this->data(place).get()); |
295 | 36 | } |
296 | | }; |
297 | | |
298 | | class AggregateFunctionPercentileApproxWeightedFourParams final |
299 | | : public AggregateFunctionPercentileApproxBase< |
300 | | AggregateFunctionPercentileApproxWeightedFourParams>, |
301 | | MultiExpression, |
302 | | NullableAggregateFunction { |
303 | | public: |
304 | | AggregateFunctionPercentileApproxWeightedFourParams(const DataTypes& argument_types_) |
305 | 22 | : AggregateFunctionPercentileApproxBase< |
306 | 22 | AggregateFunctionPercentileApproxWeightedFourParams>(argument_types_) {} |
307 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
308 | 80 | Arena&) const override { |
309 | 80 | const auto& sources = |
310 | 80 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
311 | 80 | const auto& weight = |
312 | 80 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
313 | 80 | const auto& quantile = |
314 | 80 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); |
315 | 80 | const auto& compression = |
316 | 80 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[3]); |
317 | | |
318 | 80 | this->data(place).init(quantile.get_element(0), |
319 | 80 | static_cast<float>(compression.get_element(0))); |
320 | 80 | this->data(place).add_with_weight(sources.get_element(row_num), |
321 | 80 | weight.get_element(row_num)); |
322 | 80 | } |
323 | | |
324 | 69 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
325 | | |
326 | 10 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
327 | 10 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
328 | 10 | col.get_data().push_back(this->data(place).get()); |
329 | 10 | } |
330 | | }; |
331 | | |
332 | | struct PercentileApproxArrayState { |
333 | | void init(const PaddedPODArray<Float64>& quantiles, const NullMap& null_map, size_t start, |
334 | 51 | size_t size, float compression = 10000) { |
335 | 51 | if (init_flag) { |
336 | 0 | return; |
337 | 0 | } |
338 | | |
339 | 51 | if (!std::isfinite(compression) || compression < 2048 || compression > 10000) { |
340 | 7 | compression = 10000; |
341 | 7 | } |
342 | 51 | compressions = compression; |
343 | 51 | levels.quantiles.resize(size); |
344 | 51 | levels.permutation.resize(size); |
345 | 187 | for (size_t i = 0; i < size; ++i) { |
346 | 137 | if (null_map[start + i]) { |
347 | 1 | throw Exception(ErrorCode::INVALID_ARGUMENT, |
348 | 1 | "percentile_approx_array quantile should not be null"); |
349 | 1 | } |
350 | 136 | check_quantile(quantiles[start + i]); |
351 | 136 | levels.quantiles[i] = quantiles[start + i]; |
352 | 136 | levels.permutation[i] = i; |
353 | 136 | } |
354 | 50 | if (!levels.empty()) { |
355 | 45 | digest = TDigest::create_unique(compressions); |
356 | 45 | } |
357 | 50 | init_flag = true; |
358 | 50 | } |
359 | | |
360 | 117 | void add_range(const Float64* values, size_t size) { |
361 | 117 | if (levels.empty()) { |
362 | 8 | return; |
363 | 8 | } |
364 | 255 | for (size_t i = 0; i < size; ++i) { |
365 | 146 | digest->add(static_cast<float>(values[i])); |
366 | 146 | } |
367 | 109 | } |
368 | | |
369 | 30 | void write(BufferWritable& buf) const { |
370 | 30 | buf.write_binary(init_flag); |
371 | 30 | if (!init_flag) { |
372 | 6 | return; |
373 | 6 | } |
374 | | |
375 | 24 | levels.write(buf); |
376 | 24 | buf.write_binary(compressions); |
377 | 24 | if (levels.empty()) { |
378 | 1 | return; |
379 | 1 | } |
380 | 23 | uint32_t serialize_size = digest->serialized_size(); |
381 | 23 | std::string result(serialize_size, '0'); |
382 | 23 | digest->serialize(reinterpret_cast<uint8_t*>(result.data())); |
383 | 23 | buf.write_binary(result); |
384 | 23 | } |
385 | | |
386 | 30 | void read(BufferReadable& buf) { |
387 | 30 | reset(); |
388 | 30 | buf.read_binary(init_flag); |
389 | 30 | if (!init_flag) { |
390 | 6 | return; |
391 | 6 | } |
392 | | |
393 | 24 | levels.read(buf); |
394 | 24 | buf.read_binary(compressions); |
395 | 24 | if (levels.empty()) { |
396 | 1 | return; |
397 | 1 | } |
398 | 23 | std::string str; |
399 | 23 | buf.read_binary(str); |
400 | 23 | digest = TDigest::create_unique(compressions); |
401 | 23 | digest->unserialize(reinterpret_cast<const uint8_t*>(str.data())); |
402 | 23 | } |
403 | | |
404 | 33 | void merge(const PercentileApproxArrayState& rhs) { |
405 | 33 | if (!rhs.init_flag) { |
406 | 6 | return; |
407 | 6 | } |
408 | | |
409 | 27 | if (!init_flag) { |
410 | 6 | levels.merge(rhs.levels); |
411 | 6 | compressions = rhs.compressions; |
412 | 6 | if (!levels.empty()) { |
413 | 5 | digest = TDigest::create_unique(compressions); |
414 | 5 | } |
415 | 6 | init_flag = true; |
416 | 21 | } else { |
417 | 21 | if (compressions != rhs.compressions || levels.quantiles != rhs.levels.quantiles) { |
418 | 2 | throw Exception( |
419 | 2 | ErrorCode::INVALID_ARGUMENT, |
420 | 2 | "percentile_approx_array aggregate states have incompatible quantiles " |
421 | 2 | "or compression"); |
422 | 2 | } |
423 | 21 | } |
424 | 25 | if (!levels.empty()) { |
425 | 24 | digest->merge(rhs.digest.get()); |
426 | 24 | } |
427 | 25 | } |
428 | | |
429 | 30 | void reset() { |
430 | 30 | init_flag = false; |
431 | 30 | levels.clear(); |
432 | 30 | digest.reset(); |
433 | 30 | compressions = 10000; |
434 | 30 | } |
435 | | |
436 | 30 | void insert_result_into(IColumn& to) const { |
437 | 30 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); |
438 | 30 | if (levels.empty()) { |
439 | 6 | return; |
440 | 6 | } |
441 | | |
442 | 24 | const size_t old_size = column_data.size(); |
443 | 24 | const size_t size = levels.quantiles.size(); |
444 | 24 | column_data.resize(old_size + size); |
445 | 24 | digest->quantiles(levels.quantiles.data(), levels.get_permutation().data(), size, |
446 | 24 | column_data.data() + old_size); |
447 | 24 | } |
448 | | |
449 | | bool init_flag = false; |
450 | | PercentileLevels levels; |
451 | | std::unique_ptr<TDigest> digest; |
452 | | float compressions = 10000; |
453 | | }; |
454 | | |
455 | | template <bool has_compression> |
456 | | class AggregateFunctionPercentileApproxArray final |
457 | | : public IAggregateFunctionDataHelper< |
458 | | PercentileApproxArrayState, |
459 | | AggregateFunctionPercentileApproxArray<has_compression>>, |
460 | | MultiExpression, |
461 | | NotNullableAggregateFunction { |
462 | | public: |
463 | | using Base = |
464 | | IAggregateFunctionDataHelper<PercentileApproxArrayState, |
465 | | AggregateFunctionPercentileApproxArray<has_compression>>; |
466 | | |
467 | | AggregateFunctionPercentileApproxArray(const DataTypes& argument_types_) |
468 | 37 | : Base(argument_types_) {}_ZN5doris38AggregateFunctionPercentileApproxArrayILb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS6_EE Line | Count | Source | 468 | 11 | : Base(argument_types_) {} |
_ZN5doris38AggregateFunctionPercentileApproxArrayILb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS6_EE Line | Count | Source | 468 | 26 | : Base(argument_types_) {} |
|
469 | | |
470 | 0 | String get_name() const override { return "percentile_approx_array"; }Unexecuted instantiation: _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE8get_nameB5cxx11Ev |
471 | | |
472 | 78 | DataTypePtr get_return_type() const override { |
473 | 78 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); |
474 | 78 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE15get_return_typeEv Line | Count | Source | 472 | 38 | DataTypePtr get_return_type() const override { | 473 | 38 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 474 | 38 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE15get_return_typeEv Line | Count | Source | 472 | 40 | DataTypePtr get_return_type() const override { | 473 | 40 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 474 | 40 | } |
|
475 | | |
476 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
477 | 104 | Arena&) const override { |
478 | 104 | const auto& sources = |
479 | 104 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
480 | 104 | _add_values(this->data(place), &sources.get_data()[row_num], 1, columns, |
481 | 104 | cast_set<size_t>(row_num)); |
482 | 104 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 477 | 48 | Arena&) const override { | 478 | 48 | const auto& sources = | 479 | 48 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 480 | 48 | _add_values(this->data(place), &sources.get_data()[row_num], 1, columns, | 481 | 48 | cast_set<size_t>(row_num)); | 482 | 48 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 477 | 56 | Arena&) const override { | 478 | 56 | const auto& sources = | 479 | 56 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 480 | 56 | _add_values(this->data(place), &sources.get_data()[row_num], 1, columns, | 481 | 56 | cast_set<size_t>(row_num)); | 482 | 56 | } |
|
483 | | |
484 | | void add_batch_single_place(size_t batch_size, AggregateDataPtr place, const IColumn** columns, |
485 | 16 | Arena&) const override { |
486 | 16 | const auto& sources = |
487 | 16 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
488 | 16 | DCHECK_EQ(sources.get_data().size(), batch_size); |
489 | 16 | _add_values(this->data(place), sources.get_data().data(), batch_size, columns, 0); |
490 | 16 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Line | Count | Source | 485 | 7 | Arena&) const override { | 486 | 7 | const auto& sources = | 487 | 7 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 488 | | DCHECK_EQ(sources.get_data().size(), batch_size); | 489 | 7 | _add_values(this->data(place), sources.get_data().data(), batch_size, columns, 0); | 490 | 7 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Line | Count | Source | 485 | 9 | Arena&) const override { | 486 | 9 | const auto& sources = | 487 | 9 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 488 | | DCHECK_EQ(sources.get_data().size(), batch_size); | 489 | 9 | _add_values(this->data(place), sources.get_data().data(), batch_size, columns, 0); | 490 | 9 | } |
|
491 | | |
492 | | void add_batch_range(size_t batch_begin, size_t batch_end, AggregateDataPtr place, |
493 | 1 | const IColumn** columns, Arena&, bool has_null) override { |
494 | 1 | DCHECK(!has_null); |
495 | 1 | const auto& sources = |
496 | 1 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
497 | 1 | _add_values(this->data(place), sources.get_data().data() + batch_begin, |
498 | 1 | batch_end - batch_begin + 1, columns, batch_begin); |
499 | 1 | } _ZN5doris38AggregateFunctionPercentileApproxArrayILb0EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Line | Count | Source | 493 | 1 | const IColumn** columns, Arena&, bool has_null) override { | 494 | | DCHECK(!has_null); | 495 | 1 | const auto& sources = | 496 | 1 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 497 | 1 | _add_values(this->data(place), sources.get_data().data() + batch_begin, | 498 | 1 | batch_end - batch_begin + 1, columns, batch_begin); | 499 | 1 | } |
Unexecuted instantiation: _ZN5doris38AggregateFunctionPercentileApproxArrayILb1EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb |
500 | | |
501 | 16 | void check_input_columns_type(const IColumn** columns) const override { |
502 | 16 | this->template check_argument_column_type<ColumnFloat64>(columns[0]); |
503 | 16 | check_percentile_array_column_type(*this, *columns[1], 1); |
504 | 16 | if constexpr (has_compression) { |
505 | 8 | this->template check_argument_column_type<ColumnFloat64>(columns[2]); |
506 | 8 | } |
507 | 16 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 501 | 8 | void check_input_columns_type(const IColumn** columns) const override { | 502 | 8 | this->template check_argument_column_type<ColumnFloat64>(columns[0]); | 503 | 8 | check_percentile_array_column_type(*this, *columns[1], 1); | 504 | | if constexpr (has_compression) { | 505 | | this->template check_argument_column_type<ColumnFloat64>(columns[2]); | 506 | | } | 507 | 8 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 501 | 8 | void check_input_columns_type(const IColumn** columns) const override { | 502 | 8 | this->template check_argument_column_type<ColumnFloat64>(columns[0]); | 503 | 8 | check_percentile_array_column_type(*this, *columns[1], 1); | 504 | 8 | if constexpr (has_compression) { | 505 | 8 | this->template check_argument_column_type<ColumnFloat64>(columns[2]); | 506 | 8 | } | 507 | 8 | } |
|
508 | | |
509 | 0 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); }Unexecuted instantiation: _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE5resetEPc Unexecuted instantiation: _ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE5resetEPc |
510 | | |
511 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
512 | 33 | Arena&) const override { |
513 | 33 | this->data(place).merge(this->data(rhs)); |
514 | 33 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 512 | 1 | Arena&) const override { | 513 | 1 | this->data(place).merge(this->data(rhs)); | 514 | 1 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 512 | 32 | Arena&) const override { | 513 | 32 | this->data(place).merge(this->data(rhs)); | 514 | 32 | } |
|
515 | | |
516 | 30 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
517 | 30 | this->data(place).write(buf); |
518 | 30 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 516 | 1 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 517 | 1 | this->data(place).write(buf); | 518 | 1 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 516 | 29 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 517 | 29 | this->data(place).write(buf); | 518 | 29 | } |
|
519 | | |
520 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
521 | 30 | Arena&) const override { |
522 | 30 | this->data(place).read(buf); |
523 | 30 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 521 | 1 | Arena&) const override { | 522 | 1 | this->data(place).read(buf); | 523 | 1 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 521 | 29 | Arena&) const override { | 522 | 29 | this->data(place).read(buf); | 523 | 29 | } |
|
524 | | |
525 | 30 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
526 | 30 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); |
527 | 30 | auto& nullable_data = |
528 | 30 | assert_cast<ColumnNullable&, TypeCheckOnRelease::DISABLE>(to_arr.get_data()); |
529 | 30 | auto& nested_data = nullable_data.get_nested_column(); |
530 | 30 | this->data(place).insert_result_into(nested_data); |
531 | 30 | nullable_data.get_null_map_data().resize_fill(nested_data.size(), 0); |
532 | 30 | to_arr.get_offsets().push_back(nested_data.size()); |
533 | 30 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 525 | 16 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 526 | 16 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 527 | 16 | auto& nullable_data = | 528 | 16 | assert_cast<ColumnNullable&, TypeCheckOnRelease::DISABLE>(to_arr.get_data()); | 529 | 16 | auto& nested_data = nullable_data.get_nested_column(); | 530 | 16 | this->data(place).insert_result_into(nested_data); | 531 | 16 | nullable_data.get_null_map_data().resize_fill(nested_data.size(), 0); | 532 | 16 | to_arr.get_offsets().push_back(nested_data.size()); | 533 | 16 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 525 | 14 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 526 | 14 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 527 | 14 | auto& nullable_data = | 528 | 14 | assert_cast<ColumnNullable&, TypeCheckOnRelease::DISABLE>(to_arr.get_data()); | 529 | 14 | auto& nested_data = nullable_data.get_nested_column(); | 530 | 14 | this->data(place).insert_result_into(nested_data); | 531 | 14 | nullable_data.get_null_map_data().resize_fill(nested_data.size(), 0); | 532 | 14 | to_arr.get_offsets().push_back(nested_data.size()); | 533 | 14 | } |
|
534 | | |
535 | | private: |
536 | | void _add_values(PercentileApproxArrayState& state, const Float64* values, size_t value_size, |
537 | 121 | const IColumn** columns, size_t quantile_row) const { |
538 | 121 | if (!state.init_flag) { |
539 | 51 | const auto& quantile_array = |
540 | 51 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
541 | 51 | const auto& offsets = quantile_array.get_offsets(); |
542 | 51 | const auto& nullable_quantiles = |
543 | 51 | assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
544 | 51 | quantile_array.get_data()); |
545 | 51 | const auto& quantiles = assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>( |
546 | 51 | nullable_quantiles.get_nested_column()) |
547 | 51 | .get_data(); |
548 | 51 | const auto& null_map = nullable_quantiles.get_null_map_data(); |
549 | 51 | const size_t start = quantile_row == 0 ? 0 : offsets[quantile_row - 1]; |
550 | 51 | const size_t quantile_size = offsets[quantile_row] - start; |
551 | | |
552 | 51 | float compression = 10000; |
553 | 51 | if constexpr (has_compression) { |
554 | 35 | const auto& compression_column = |
555 | 35 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); |
556 | 35 | compression = static_cast<float>(compression_column.get_element(0)); |
557 | 35 | } |
558 | 51 | state.init(quantiles, null_map, start, quantile_size, compression); |
559 | 51 | } |
560 | 121 | state.add_range(values, value_size); |
561 | 121 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE11_add_valuesERNS_26PercentileApproxArrayStateEPKdmPPKNS_7IColumnEm Line | Count | Source | 537 | 56 | const IColumn** columns, size_t quantile_row) const { | 538 | 56 | if (!state.init_flag) { | 539 | 16 | const auto& quantile_array = | 540 | 16 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 541 | 16 | const auto& offsets = quantile_array.get_offsets(); | 542 | 16 | const auto& nullable_quantiles = | 543 | 16 | assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 544 | 16 | quantile_array.get_data()); | 545 | 16 | const auto& quantiles = assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>( | 546 | 16 | nullable_quantiles.get_nested_column()) | 547 | 16 | .get_data(); | 548 | 16 | const auto& null_map = nullable_quantiles.get_null_map_data(); | 549 | 16 | const size_t start = quantile_row == 0 ? 0 : offsets[quantile_row - 1]; | 550 | 16 | const size_t quantile_size = offsets[quantile_row] - start; | 551 | | | 552 | 16 | float compression = 10000; | 553 | | if constexpr (has_compression) { | 554 | | const auto& compression_column = | 555 | | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); | 556 | | compression = static_cast<float>(compression_column.get_element(0)); | 557 | | } | 558 | 16 | state.init(quantiles, null_map, start, quantile_size, compression); | 559 | 16 | } | 560 | 56 | state.add_range(values, value_size); | 561 | 56 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE11_add_valuesERNS_26PercentileApproxArrayStateEPKdmPPKNS_7IColumnEm Line | Count | Source | 537 | 65 | const IColumn** columns, size_t quantile_row) const { | 538 | 65 | if (!state.init_flag) { | 539 | 35 | const auto& quantile_array = | 540 | 35 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 541 | 35 | const auto& offsets = quantile_array.get_offsets(); | 542 | 35 | const auto& nullable_quantiles = | 543 | 35 | assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 544 | 35 | quantile_array.get_data()); | 545 | 35 | const auto& quantiles = assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>( | 546 | 35 | nullable_quantiles.get_nested_column()) | 547 | 35 | .get_data(); | 548 | 35 | const auto& null_map = nullable_quantiles.get_null_map_data(); | 549 | 35 | const size_t start = quantile_row == 0 ? 0 : offsets[quantile_row - 1]; | 550 | 35 | const size_t quantile_size = offsets[quantile_row] - start; | 551 | | | 552 | 35 | float compression = 10000; | 553 | 35 | if constexpr (has_compression) { | 554 | 35 | const auto& compression_column = | 555 | 35 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); | 556 | 35 | compression = static_cast<float>(compression_column.get_element(0)); | 557 | 35 | } | 558 | 35 | state.init(quantiles, null_map, start, quantile_size, compression); | 559 | 35 | } | 560 | 65 | state.add_range(values, value_size); | 561 | 65 | } |
|
562 | | }; |
563 | | |
564 | | template <PrimitiveType T> |
565 | | struct PercentileState { |
566 | | mutable std::vector<Counts<typename PrimitiveTypeTraits<T>::CppType>> vec_counts; |
567 | | std::vector<double> vec_quantile {-1}; |
568 | | bool inited_flag = false; |
569 | | |
570 | 396 | void write(BufferWritable& buf) const { |
571 | 396 | buf.write_binary(inited_flag); |
572 | 396 | if (!inited_flag) { |
573 | 8 | return; |
574 | 8 | } |
575 | 388 | int size_num = cast_set<int>(vec_quantile.size()); |
576 | 388 | buf.write_binary(size_num); |
577 | 692 | for (const auto& quantile : vec_quantile) { |
578 | 692 | buf.write_binary(quantile); |
579 | 692 | } |
580 | 692 | for (auto& counts : vec_counts) { |
581 | 692 | counts.serialize(buf); |
582 | 692 | } |
583 | 388 | } Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE3EE5writeERNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE4EE5writeERNS_14BufferWritableE _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE5EE5writeERNS_14BufferWritableE Line | Count | Source | 570 | 160 | void write(BufferWritable& buf) const { | 571 | 160 | buf.write_binary(inited_flag); | 572 | 160 | if (!inited_flag) { | 573 | 8 | return; | 574 | 8 | } | 575 | 152 | int size_num = cast_set<int>(vec_quantile.size()); | 576 | 152 | buf.write_binary(size_num); | 577 | 456 | for (const auto& quantile : vec_quantile) { | 578 | 456 | buf.write_binary(quantile); | 579 | 456 | } | 580 | 456 | for (auto& counts : vec_counts) { | 581 | 456 | counts.serialize(buf); | 582 | 456 | } | 583 | 152 | } |
_ZNK5doris15PercentileStateILNS_13PrimitiveTypeE6EE5writeERNS_14BufferWritableE Line | Count | Source | 570 | 236 | void write(BufferWritable& buf) const { | 571 | 236 | buf.write_binary(inited_flag); | 572 | 236 | if (!inited_flag) { | 573 | 0 | return; | 574 | 0 | } | 575 | 236 | int size_num = cast_set<int>(vec_quantile.size()); | 576 | 236 | buf.write_binary(size_num); | 577 | 236 | for (const auto& quantile : vec_quantile) { | 578 | 236 | buf.write_binary(quantile); | 579 | 236 | } | 580 | 236 | for (auto& counts : vec_counts) { | 581 | 236 | counts.serialize(buf); | 582 | 236 | } | 583 | 236 | } |
Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE7EE5writeERNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE8EE5writeERNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE9EE5writeERNS_14BufferWritableE |
584 | | |
585 | 357 | void read(BufferReadable& buf) { |
586 | 357 | buf.read_binary(inited_flag); |
587 | 357 | if (!inited_flag) { |
588 | 8 | return; |
589 | 8 | } |
590 | 349 | int size_num = 0; |
591 | 349 | buf.read_binary(size_num); |
592 | 349 | double data = 0.0; |
593 | 349 | vec_quantile.clear(); |
594 | 924 | for (int i = 0; i < size_num; ++i) { |
595 | 575 | buf.read_binary(data); |
596 | 575 | vec_quantile.emplace_back(data); |
597 | 575 | } |
598 | 349 | vec_counts.clear(); |
599 | 349 | vec_counts.resize(size_num); |
600 | 924 | for (int i = 0; i < size_num; ++i) { |
601 | 575 | vec_counts[i].unserialize(buf); |
602 | 575 | } |
603 | 349 | } Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE3EE4readERNS_14BufferReadableE Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE4EE4readERNS_14BufferReadableE _ZN5doris15PercentileStateILNS_13PrimitiveTypeE5EE4readERNS_14BufferReadableE Line | Count | Source | 585 | 121 | void read(BufferReadable& buf) { | 586 | 121 | buf.read_binary(inited_flag); | 587 | 121 | if (!inited_flag) { | 588 | 8 | return; | 589 | 8 | } | 590 | 113 | int size_num = 0; | 591 | 113 | buf.read_binary(size_num); | 592 | 113 | double data = 0.0; | 593 | 113 | vec_quantile.clear(); | 594 | 452 | for (int i = 0; i < size_num; ++i) { | 595 | 339 | buf.read_binary(data); | 596 | 339 | vec_quantile.emplace_back(data); | 597 | 339 | } | 598 | 113 | vec_counts.clear(); | 599 | 113 | vec_counts.resize(size_num); | 600 | 452 | for (int i = 0; i < size_num; ++i) { | 601 | 339 | vec_counts[i].unserialize(buf); | 602 | 339 | } | 603 | 113 | } |
_ZN5doris15PercentileStateILNS_13PrimitiveTypeE6EE4readERNS_14BufferReadableE Line | Count | Source | 585 | 236 | void read(BufferReadable& buf) { | 586 | 236 | buf.read_binary(inited_flag); | 587 | 236 | if (!inited_flag) { | 588 | 0 | return; | 589 | 0 | } | 590 | 236 | int size_num = 0; | 591 | 236 | buf.read_binary(size_num); | 592 | 236 | double data = 0.0; | 593 | 236 | vec_quantile.clear(); | 594 | 472 | for (int i = 0; i < size_num; ++i) { | 595 | 236 | buf.read_binary(data); | 596 | 236 | vec_quantile.emplace_back(data); | 597 | 236 | } | 598 | 236 | vec_counts.clear(); | 599 | 236 | vec_counts.resize(size_num); | 600 | 472 | for (int i = 0; i < size_num; ++i) { | 601 | 236 | vec_counts[i].unserialize(buf); | 602 | 236 | } | 603 | 236 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE7EE4readERNS_14BufferReadableE Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE8EE4readERNS_14BufferReadableE Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE9EE4readERNS_14BufferReadableE |
604 | | |
605 | | void add(typename PrimitiveTypeTraits<T>::CppType source, |
606 | 222 | const PaddedPODArray<Float64>& quantiles, const NullMap& null_maps, int64_t arg_size) { |
607 | 222 | if (!inited_flag) { |
608 | 222 | vec_counts.resize(arg_size); |
609 | 222 | vec_quantile.resize(arg_size, -1); |
610 | 222 | inited_flag = true; |
611 | 644 | for (int i = 0; i < arg_size; ++i) { |
612 | | // throw Exception func call percentile_array(id, [1,0,null]) |
613 | 422 | if (null_maps[i]) { |
614 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, |
615 | 0 | "quantiles in func percentile_array should not have null"); |
616 | 0 | } |
617 | 422 | check_quantile(quantiles[i]); |
618 | 422 | vec_quantile[i] = quantiles[i]; |
619 | 422 | } |
620 | 222 | } |
621 | 644 | for (int i = 0; i < arg_size; ++i) { |
622 | 422 | vec_counts[i].increment(source); |
623 | 422 | } |
624 | 222 | } Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE3EE3addEaRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE4EE3addEsRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl _ZN5doris15PercentileStateILNS_13PrimitiveTypeE5EE3addEiRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl Line | Count | Source | 606 | 100 | const PaddedPODArray<Float64>& quantiles, const NullMap& null_maps, int64_t arg_size) { | 607 | 100 | if (!inited_flag) { | 608 | 100 | vec_counts.resize(arg_size); | 609 | 100 | vec_quantile.resize(arg_size, -1); | 610 | 100 | inited_flag = true; | 611 | 400 | for (int i = 0; i < arg_size; ++i) { | 612 | | // throw Exception func call percentile_array(id, [1,0,null]) | 613 | 300 | if (null_maps[i]) { | 614 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 615 | 0 | "quantiles in func percentile_array should not have null"); | 616 | 0 | } | 617 | 300 | check_quantile(quantiles[i]); | 618 | 300 | vec_quantile[i] = quantiles[i]; | 619 | 300 | } | 620 | 100 | } | 621 | 400 | for (int i = 0; i < arg_size; ++i) { | 622 | 300 | vec_counts[i].increment(source); | 623 | 300 | } | 624 | 100 | } |
_ZN5doris15PercentileStateILNS_13PrimitiveTypeE6EE3addElRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl Line | Count | Source | 606 | 122 | const PaddedPODArray<Float64>& quantiles, const NullMap& null_maps, int64_t arg_size) { | 607 | 122 | if (!inited_flag) { | 608 | 122 | vec_counts.resize(arg_size); | 609 | 122 | vec_quantile.resize(arg_size, -1); | 610 | 122 | inited_flag = true; | 611 | 244 | for (int i = 0; i < arg_size; ++i) { | 612 | | // throw Exception func call percentile_array(id, [1,0,null]) | 613 | 122 | if (null_maps[i]) { | 614 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 615 | 0 | "quantiles in func percentile_array should not have null"); | 616 | 0 | } | 617 | 122 | check_quantile(quantiles[i]); | 618 | 122 | vec_quantile[i] = quantiles[i]; | 619 | 122 | } | 620 | 122 | } | 621 | 244 | for (int i = 0; i < arg_size; ++i) { | 622 | 122 | vec_counts[i].increment(source); | 623 | 122 | } | 624 | 122 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE7EE3addEnRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE8EE3addEfRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE9EE3addEdRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl |
625 | | |
626 | | void add_batch(const PaddedPODArray<typename PrimitiveTypeTraits<T>::CppType>& source, |
627 | 0 | const Float64& q) { |
628 | 0 | if (!inited_flag) { |
629 | 0 | inited_flag = true; |
630 | 0 | vec_counts.resize(1); |
631 | 0 | vec_quantile.resize(1); |
632 | 0 | check_quantile(q); |
633 | 0 | vec_quantile[0] = q; |
634 | 0 | } |
635 | 0 | vec_counts[0].increment_batch(source); |
636 | 0 | } Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE3EE9add_batchERKNS_8PODArrayIaLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKd Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE4EE9add_batchERKNS_8PODArrayIsLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKd Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE5EE9add_batchERKNS_8PODArrayIiLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKd Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE6EE9add_batchERKNS_8PODArrayIlLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKd Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE7EE9add_batchERKNS_8PODArrayInLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKd Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE8EE9add_batchERKNS_8PODArrayIfLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKd Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE9EE9add_batchERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKd |
637 | | |
638 | 357 | void merge(const PercentileState& rhs) { |
639 | 357 | if (!rhs.inited_flag) { |
640 | 8 | return; |
641 | 8 | } |
642 | 349 | int size_num = cast_set<int>(rhs.vec_quantile.size()); |
643 | 349 | if (!inited_flag) { |
644 | 190 | vec_counts.resize(size_num); |
645 | 190 | vec_quantile.resize(size_num, -1); |
646 | 190 | inited_flag = true; |
647 | 190 | } |
648 | | |
649 | 924 | for (int i = 0; i < size_num; ++i) { |
650 | 575 | if (vec_quantile[i] == -1.0) { |
651 | 294 | vec_quantile[i] = rhs.vec_quantile[i]; |
652 | 294 | } |
653 | 575 | vec_counts[i].merge(&(rhs.vec_counts[i])); |
654 | 575 | } |
655 | 349 | } Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE3EE5mergeERKS2_ Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE4EE5mergeERKS2_ _ZN5doris15PercentileStateILNS_13PrimitiveTypeE5EE5mergeERKS2_ Line | Count | Source | 638 | 121 | void merge(const PercentileState& rhs) { | 639 | 121 | if (!rhs.inited_flag) { | 640 | 8 | return; | 641 | 8 | } | 642 | 113 | int size_num = cast_set<int>(rhs.vec_quantile.size()); | 643 | 113 | if (!inited_flag) { | 644 | 52 | vec_counts.resize(size_num); | 645 | 52 | vec_quantile.resize(size_num, -1); | 646 | 52 | inited_flag = true; | 647 | 52 | } | 648 | | | 649 | 452 | for (int i = 0; i < size_num; ++i) { | 650 | 339 | if (vec_quantile[i] == -1.0) { | 651 | 156 | vec_quantile[i] = rhs.vec_quantile[i]; | 652 | 156 | } | 653 | 339 | vec_counts[i].merge(&(rhs.vec_counts[i])); | 654 | 339 | } | 655 | 113 | } |
_ZN5doris15PercentileStateILNS_13PrimitiveTypeE6EE5mergeERKS2_ Line | Count | Source | 638 | 236 | void merge(const PercentileState& rhs) { | 639 | 236 | if (!rhs.inited_flag) { | 640 | 0 | return; | 641 | 0 | } | 642 | 236 | int size_num = cast_set<int>(rhs.vec_quantile.size()); | 643 | 236 | if (!inited_flag) { | 644 | 138 | vec_counts.resize(size_num); | 645 | 138 | vec_quantile.resize(size_num, -1); | 646 | 138 | inited_flag = true; | 647 | 138 | } | 648 | | | 649 | 472 | for (int i = 0; i < size_num; ++i) { | 650 | 236 | if (vec_quantile[i] == -1.0) { | 651 | 138 | vec_quantile[i] = rhs.vec_quantile[i]; | 652 | 138 | } | 653 | 236 | vec_counts[i].merge(&(rhs.vec_counts[i])); | 654 | 236 | } | 655 | 236 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE7EE5mergeERKS2_ Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE8EE5mergeERKS2_ Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE9EE5mergeERKS2_ |
656 | | |
657 | 107 | void reset() { |
658 | 107 | vec_counts.clear(); |
659 | 107 | vec_quantile.clear(); |
660 | 107 | inited_flag = false; |
661 | 107 | } Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE3EE5resetEv Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE4EE5resetEv _ZN5doris15PercentileStateILNS_13PrimitiveTypeE5EE5resetEv Line | Count | Source | 657 | 26 | void reset() { | 658 | 26 | vec_counts.clear(); | 659 | 26 | vec_quantile.clear(); | 660 | 26 | inited_flag = false; | 661 | 26 | } |
_ZN5doris15PercentileStateILNS_13PrimitiveTypeE6EE5resetEv Line | Count | Source | 657 | 81 | void reset() { | 658 | 81 | vec_counts.clear(); | 659 | 81 | vec_quantile.clear(); | 660 | 81 | inited_flag = false; | 661 | 81 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE7EE5resetEv Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE8EE5resetEv Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE9EE5resetEv |
662 | | |
663 | 24 | double get() const { return vec_counts.empty() ? 0 : vec_counts[0].terminate(vec_quantile[0]); }Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE3EE3getEv Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE4EE3getEv Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE5EE3getEv _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE6EE3getEv Line | Count | Source | 663 | 24 | double get() const { return vec_counts.empty() ? 0 : vec_counts[0].terminate(vec_quantile[0]); } |
Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE7EE3getEv Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE8EE3getEv Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE9EE3getEv |
664 | | |
665 | 0 | void insert_result_into(IColumn& to) const { |
666 | 0 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); |
667 | 0 | for (int i = 0; i < vec_counts.size(); ++i) { |
668 | 0 | column_data.push_back(vec_counts[i].terminate(vec_quantile[i])); |
669 | 0 | } |
670 | 0 | } Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE3EE18insert_result_intoERNS_7IColumnE Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE4EE18insert_result_intoERNS_7IColumnE Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE5EE18insert_result_intoERNS_7IColumnE Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE6EE18insert_result_intoERNS_7IColumnE Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE7EE18insert_result_intoERNS_7IColumnE Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE8EE18insert_result_intoERNS_7IColumnE Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE9EE18insert_result_intoERNS_7IColumnE |
671 | | }; |
672 | | |
673 | | template <PrimitiveType T> |
674 | | struct PercentileExactState { |
675 | | using ValueType = typename PrimitiveTypeTraits<T>::CppType; |
676 | | static constexpr size_t bytes_in_arena = 64 - sizeof(PODArray<ValueType>); |
677 | | using Array = PODArrayWithStackMemory<ValueType, bytes_in_arena>; |
678 | | |
679 | 860 | void add_single_range(const ValueType* data, size_t count, double quantile) { |
680 | 860 | if (!inited_flag) { |
681 | 330 | _set_single_level(quantile); |
682 | 330 | inited_flag = true; |
683 | 330 | } |
684 | 860 | _append(data, count); |
685 | 860 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE16add_single_rangeEPKamd Line | Count | Source | 679 | 31 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 680 | 31 | if (!inited_flag) { | 681 | 6 | _set_single_level(quantile); | 682 | 6 | inited_flag = true; | 683 | 6 | } | 684 | 31 | _append(data, count); | 685 | 31 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE16add_single_rangeEPKsmd Line | Count | Source | 679 | 311 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 680 | 311 | if (!inited_flag) { | 681 | 100 | _set_single_level(quantile); | 682 | 100 | inited_flag = true; | 683 | 100 | } | 684 | 311 | _append(data, count); | 685 | 311 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE16add_single_rangeEPKimd Line | Count | Source | 679 | 264 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 680 | 264 | if (!inited_flag) { | 681 | 79 | _set_single_level(quantile); | 682 | 79 | inited_flag = true; | 683 | 79 | } | 684 | 264 | _append(data, count); | 685 | 264 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE16add_single_rangeEPKlmd Line | Count | Source | 679 | 196 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 680 | 196 | if (!inited_flag) { | 681 | 112 | _set_single_level(quantile); | 682 | 112 | inited_flag = true; | 683 | 112 | } | 684 | 196 | _append(data, count); | 685 | 196 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE16add_single_rangeEPKnmd Line | Count | Source | 679 | 3 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 680 | 3 | if (!inited_flag) { | 681 | 2 | _set_single_level(quantile); | 682 | 2 | inited_flag = true; | 683 | 2 | } | 684 | 3 | _append(data, count); | 685 | 3 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE16add_single_rangeEPKfmd Line | Count | Source | 679 | 6 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 680 | 6 | if (!inited_flag) { | 681 | 3 | _set_single_level(quantile); | 682 | 3 | inited_flag = true; | 683 | 3 | } | 684 | 6 | _append(data, count); | 685 | 6 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE16add_single_rangeEPKdmd Line | Count | Source | 679 | 49 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 680 | 49 | if (!inited_flag) { | 681 | 28 | _set_single_level(quantile); | 682 | 28 | inited_flag = true; | 683 | 28 | } | 684 | 49 | _append(data, count); | 685 | 49 | } |
|
686 | | |
687 | | void add_many_range(const ValueType* data, size_t count, |
688 | | const PaddedPODArray<Float64>& quantiles_data, const NullMap& null_maps, |
689 | 702 | size_t start, int64_t arg_size) { |
690 | 702 | if (!inited_flag) { |
691 | 317 | _set_many_levels(quantiles_data, null_maps, start, arg_size); |
692 | 317 | inited_flag = true; |
693 | 317 | } |
694 | 702 | if (levels.empty()) { |
695 | 0 | return; |
696 | 0 | } |
697 | 702 | _append(data, count); |
698 | 702 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE14add_many_rangeEPKamRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 689 | 15 | size_t start, int64_t arg_size) { | 690 | 15 | if (!inited_flag) { | 691 | 11 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 692 | 11 | inited_flag = true; | 693 | 11 | } | 694 | 15 | if (levels.empty()) { | 695 | 0 | return; | 696 | 0 | } | 697 | 15 | _append(data, count); | 698 | 15 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE14add_many_rangeEPKsmRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 689 | 30 | size_t start, int64_t arg_size) { | 690 | 30 | if (!inited_flag) { | 691 | 12 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 692 | 12 | inited_flag = true; | 693 | 12 | } | 694 | 30 | if (levels.empty()) { | 695 | 0 | return; | 696 | 0 | } | 697 | 30 | _append(data, count); | 698 | 30 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE14add_many_rangeEPKimRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 689 | 517 | size_t start, int64_t arg_size) { | 690 | 517 | if (!inited_flag) { | 691 | 226 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 692 | 226 | inited_flag = true; | 693 | 226 | } | 694 | 517 | if (levels.empty()) { | 695 | 0 | return; | 696 | 0 | } | 697 | 517 | _append(data, count); | 698 | 517 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE14add_many_rangeEPKlmRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 689 | 33 | size_t start, int64_t arg_size) { | 690 | 33 | if (!inited_flag) { | 691 | 15 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 692 | 15 | inited_flag = true; | 693 | 15 | } | 694 | 33 | if (levels.empty()) { | 695 | 0 | return; | 696 | 0 | } | 697 | 33 | _append(data, count); | 698 | 33 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE14add_many_rangeEPKnmRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 689 | 15 | size_t start, int64_t arg_size) { | 690 | 15 | if (!inited_flag) { | 691 | 11 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 692 | 11 | inited_flag = true; | 693 | 11 | } | 694 | 15 | if (levels.empty()) { | 695 | 0 | return; | 696 | 0 | } | 697 | 15 | _append(data, count); | 698 | 15 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE14add_many_rangeEPKfmRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 689 | 3 | size_t start, int64_t arg_size) { | 690 | 3 | if (!inited_flag) { | 691 | 1 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 692 | 1 | inited_flag = true; | 693 | 1 | } | 694 | 3 | if (levels.empty()) { | 695 | 0 | return; | 696 | 0 | } | 697 | 3 | _append(data, count); | 698 | 3 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE14add_many_rangeEPKdmRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 689 | 89 | size_t start, int64_t arg_size) { | 690 | 89 | if (!inited_flag) { | 691 | 41 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 692 | 41 | inited_flag = true; | 693 | 41 | } | 694 | 89 | if (levels.empty()) { | 695 | 0 | return; | 696 | 0 | } | 697 | 89 | _append(data, count); | 698 | 89 | } |
|
699 | | |
700 | 378 | void write(BufferWritable& buf) const { |
701 | 378 | buf.write_binary(inited_flag); |
702 | 378 | if (!inited_flag) { |
703 | 1 | return; |
704 | 1 | } |
705 | | |
706 | 377 | levels.write(buf); |
707 | 377 | size_t size = values.size(); |
708 | 377 | buf.write_binary(size); |
709 | 377 | if (size > 0) { |
710 | 375 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); |
711 | 375 | } |
712 | 377 | } _ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE5writeERNS_14BufferWritableE Line | Count | Source | 700 | 2 | void write(BufferWritable& buf) const { | 701 | 2 | buf.write_binary(inited_flag); | 702 | 2 | if (!inited_flag) { | 703 | 0 | return; | 704 | 0 | } | 705 | | | 706 | 2 | levels.write(buf); | 707 | 2 | size_t size = values.size(); | 708 | 2 | buf.write_binary(size); | 709 | 2 | if (size > 0) { | 710 | 2 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 711 | 2 | } | 712 | 2 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE5writeERNS_14BufferWritableE Line | Count | Source | 700 | 2 | void write(BufferWritable& buf) const { | 701 | 2 | buf.write_binary(inited_flag); | 702 | 2 | if (!inited_flag) { | 703 | 0 | return; | 704 | 0 | } | 705 | | | 706 | 2 | levels.write(buf); | 707 | 2 | size_t size = values.size(); | 708 | 2 | buf.write_binary(size); | 709 | 2 | if (size > 0) { | 710 | 2 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 711 | 2 | } | 712 | 2 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE5writeERNS_14BufferWritableE Line | Count | Source | 700 | 236 | void write(BufferWritable& buf) const { | 701 | 236 | buf.write_binary(inited_flag); | 702 | 236 | if (!inited_flag) { | 703 | 1 | return; | 704 | 1 | } | 705 | | | 706 | 235 | levels.write(buf); | 707 | 235 | size_t size = values.size(); | 708 | 235 | buf.write_binary(size); | 709 | 235 | if (size > 0) { | 710 | 235 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 711 | 235 | } | 712 | 235 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE5writeERNS_14BufferWritableE Line | Count | Source | 700 | 92 | void write(BufferWritable& buf) const { | 701 | 92 | buf.write_binary(inited_flag); | 702 | 92 | if (!inited_flag) { | 703 | 0 | return; | 704 | 0 | } | 705 | | | 706 | 92 | levels.write(buf); | 707 | 92 | size_t size = values.size(); | 708 | 92 | buf.write_binary(size); | 709 | 92 | if (size > 0) { | 710 | 92 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 711 | 92 | } | 712 | 92 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE5writeERNS_14BufferWritableE Line | Count | Source | 700 | 2 | void write(BufferWritable& buf) const { | 701 | 2 | buf.write_binary(inited_flag); | 702 | 2 | if (!inited_flag) { | 703 | 0 | return; | 704 | 0 | } | 705 | | | 706 | 2 | levels.write(buf); | 707 | 2 | size_t size = values.size(); | 708 | 2 | buf.write_binary(size); | 709 | 2 | if (size > 0) { | 710 | 2 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 711 | 2 | } | 712 | 2 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE5writeERNS_14BufferWritableE Line | Count | Source | 700 | 3 | void write(BufferWritable& buf) const { | 701 | 3 | buf.write_binary(inited_flag); | 702 | 3 | if (!inited_flag) { | 703 | 0 | return; | 704 | 0 | } | 705 | | | 706 | 3 | levels.write(buf); | 707 | 3 | size_t size = values.size(); | 708 | 3 | buf.write_binary(size); | 709 | 3 | if (size > 0) { | 710 | 3 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 711 | 3 | } | 712 | 3 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE5writeERNS_14BufferWritableE Line | Count | Source | 700 | 41 | void write(BufferWritable& buf) const { | 701 | 41 | buf.write_binary(inited_flag); | 702 | 41 | if (!inited_flag) { | 703 | 0 | return; | 704 | 0 | } | 705 | | | 706 | 41 | levels.write(buf); | 707 | 41 | size_t size = values.size(); | 708 | 41 | buf.write_binary(size); | 709 | 41 | if (size > 0) { | 710 | 39 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 711 | 39 | } | 712 | 41 | } |
|
713 | | |
714 | 377 | void read(BufferReadable& buf) { |
715 | 377 | reset(); |
716 | 377 | buf.read_binary(inited_flag); |
717 | 377 | if (!inited_flag) { |
718 | 1 | return; |
719 | 1 | } |
720 | | |
721 | 376 | levels.read(buf); |
722 | 376 | size_t size = 0; |
723 | 376 | buf.read_binary(size); |
724 | 376 | values.resize(size); |
725 | 376 | if (size > 0) { |
726 | 374 | auto raw = buf.read(sizeof(ValueType) * size); |
727 | 374 | memcpy(values.data(), raw.data, raw.size); |
728 | 374 | } |
729 | 376 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE4readERNS_14BufferReadableE Line | Count | Source | 714 | 2 | void read(BufferReadable& buf) { | 715 | 2 | reset(); | 716 | 2 | buf.read_binary(inited_flag); | 717 | 2 | if (!inited_flag) { | 718 | 0 | return; | 719 | 0 | } | 720 | | | 721 | 2 | levels.read(buf); | 722 | 2 | size_t size = 0; | 723 | 2 | buf.read_binary(size); | 724 | 2 | values.resize(size); | 725 | 2 | if (size > 0) { | 726 | 2 | auto raw = buf.read(sizeof(ValueType) * size); | 727 | 2 | memcpy(values.data(), raw.data, raw.size); | 728 | 2 | } | 729 | 2 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE4readERNS_14BufferReadableE Line | Count | Source | 714 | 2 | void read(BufferReadable& buf) { | 715 | 2 | reset(); | 716 | 2 | buf.read_binary(inited_flag); | 717 | 2 | if (!inited_flag) { | 718 | 0 | return; | 719 | 0 | } | 720 | | | 721 | 2 | levels.read(buf); | 722 | 2 | size_t size = 0; | 723 | 2 | buf.read_binary(size); | 724 | 2 | values.resize(size); | 725 | 2 | if (size > 0) { | 726 | 2 | auto raw = buf.read(sizeof(ValueType) * size); | 727 | 2 | memcpy(values.data(), raw.data, raw.size); | 728 | 2 | } | 729 | 2 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE4readERNS_14BufferReadableE Line | Count | Source | 714 | 235 | void read(BufferReadable& buf) { | 715 | 235 | reset(); | 716 | 235 | buf.read_binary(inited_flag); | 717 | 235 | if (!inited_flag) { | 718 | 1 | return; | 719 | 1 | } | 720 | | | 721 | 234 | levels.read(buf); | 722 | 234 | size_t size = 0; | 723 | 234 | buf.read_binary(size); | 724 | 234 | values.resize(size); | 725 | 234 | if (size > 0) { | 726 | 234 | auto raw = buf.read(sizeof(ValueType) * size); | 727 | 234 | memcpy(values.data(), raw.data, raw.size); | 728 | 234 | } | 729 | 234 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE4readERNS_14BufferReadableE Line | Count | Source | 714 | 92 | void read(BufferReadable& buf) { | 715 | 92 | reset(); | 716 | 92 | buf.read_binary(inited_flag); | 717 | 92 | if (!inited_flag) { | 718 | 0 | return; | 719 | 0 | } | 720 | | | 721 | 92 | levels.read(buf); | 722 | 92 | size_t size = 0; | 723 | 92 | buf.read_binary(size); | 724 | 92 | values.resize(size); | 725 | 92 | if (size > 0) { | 726 | 92 | auto raw = buf.read(sizeof(ValueType) * size); | 727 | 92 | memcpy(values.data(), raw.data, raw.size); | 728 | 92 | } | 729 | 92 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE4readERNS_14BufferReadableE Line | Count | Source | 714 | 2 | void read(BufferReadable& buf) { | 715 | 2 | reset(); | 716 | 2 | buf.read_binary(inited_flag); | 717 | 2 | if (!inited_flag) { | 718 | 0 | return; | 719 | 0 | } | 720 | | | 721 | 2 | levels.read(buf); | 722 | 2 | size_t size = 0; | 723 | 2 | buf.read_binary(size); | 724 | 2 | values.resize(size); | 725 | 2 | if (size > 0) { | 726 | 2 | auto raw = buf.read(sizeof(ValueType) * size); | 727 | 2 | memcpy(values.data(), raw.data, raw.size); | 728 | 2 | } | 729 | 2 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE4readERNS_14BufferReadableE Line | Count | Source | 714 | 3 | void read(BufferReadable& buf) { | 715 | 3 | reset(); | 716 | 3 | buf.read_binary(inited_flag); | 717 | 3 | if (!inited_flag) { | 718 | 0 | return; | 719 | 0 | } | 720 | | | 721 | 3 | levels.read(buf); | 722 | 3 | size_t size = 0; | 723 | 3 | buf.read_binary(size); | 724 | 3 | values.resize(size); | 725 | 3 | if (size > 0) { | 726 | 3 | auto raw = buf.read(sizeof(ValueType) * size); | 727 | 3 | memcpy(values.data(), raw.data, raw.size); | 728 | 3 | } | 729 | 3 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE4readERNS_14BufferReadableE Line | Count | Source | 714 | 41 | void read(BufferReadable& buf) { | 715 | 41 | reset(); | 716 | 41 | buf.read_binary(inited_flag); | 717 | 41 | if (!inited_flag) { | 718 | 0 | return; | 719 | 0 | } | 720 | | | 721 | 41 | levels.read(buf); | 722 | 41 | size_t size = 0; | 723 | 41 | buf.read_binary(size); | 724 | 41 | values.resize(size); | 725 | 41 | if (size > 0) { | 726 | 39 | auto raw = buf.read(sizeof(ValueType) * size); | 727 | 39 | memcpy(values.data(), raw.data, raw.size); | 728 | 39 | } | 729 | 41 | } |
|
730 | | |
731 | 378 | void merge(const PercentileExactState& rhs) { |
732 | 378 | if (!rhs.inited_flag) { |
733 | 1 | return; |
734 | 1 | } |
735 | | |
736 | 377 | if (!inited_flag) { |
737 | 249 | levels = rhs.levels; |
738 | 249 | inited_flag = true; |
739 | 249 | } else { |
740 | 128 | levels.merge(rhs.levels); |
741 | 128 | } |
742 | 377 | _append(rhs.values.data(), rhs.values.size()); |
743 | 377 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE5mergeERKS2_ Line | Count | Source | 731 | 2 | void merge(const PercentileExactState& rhs) { | 732 | 2 | if (!rhs.inited_flag) { | 733 | 0 | return; | 734 | 0 | } | 735 | | | 736 | 2 | if (!inited_flag) { | 737 | 1 | levels = rhs.levels; | 738 | 1 | inited_flag = true; | 739 | 1 | } else { | 740 | 1 | levels.merge(rhs.levels); | 741 | 1 | } | 742 | 2 | _append(rhs.values.data(), rhs.values.size()); | 743 | 2 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE5mergeERKS2_ Line | Count | Source | 731 | 2 | void merge(const PercentileExactState& rhs) { | 732 | 2 | if (!rhs.inited_flag) { | 733 | 0 | return; | 734 | 0 | } | 735 | | | 736 | 2 | if (!inited_flag) { | 737 | 1 | levels = rhs.levels; | 738 | 1 | inited_flag = true; | 739 | 1 | } else { | 740 | 1 | levels.merge(rhs.levels); | 741 | 1 | } | 742 | 2 | _append(rhs.values.data(), rhs.values.size()); | 743 | 2 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE5mergeERKS2_ Line | Count | Source | 731 | 236 | void merge(const PercentileExactState& rhs) { | 732 | 236 | if (!rhs.inited_flag) { | 733 | 1 | return; | 734 | 1 | } | 735 | | | 736 | 235 | if (!inited_flag) { | 737 | 171 | levels = rhs.levels; | 738 | 171 | inited_flag = true; | 739 | 171 | } else { | 740 | 64 | levels.merge(rhs.levels); | 741 | 64 | } | 742 | 235 | _append(rhs.values.data(), rhs.values.size()); | 743 | 235 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE5mergeERKS2_ Line | Count | Source | 731 | 92 | void merge(const PercentileExactState& rhs) { | 732 | 92 | if (!rhs.inited_flag) { | 733 | 0 | return; | 734 | 0 | } | 735 | | | 736 | 92 | if (!inited_flag) { | 737 | 45 | levels = rhs.levels; | 738 | 45 | inited_flag = true; | 739 | 47 | } else { | 740 | 47 | levels.merge(rhs.levels); | 741 | 47 | } | 742 | 92 | _append(rhs.values.data(), rhs.values.size()); | 743 | 92 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE5mergeERKS2_ Line | Count | Source | 731 | 2 | void merge(const PercentileExactState& rhs) { | 732 | 2 | if (!rhs.inited_flag) { | 733 | 0 | return; | 734 | 0 | } | 735 | | | 736 | 2 | if (!inited_flag) { | 737 | 1 | levels = rhs.levels; | 738 | 1 | inited_flag = true; | 739 | 1 | } else { | 740 | 1 | levels.merge(rhs.levels); | 741 | 1 | } | 742 | 2 | _append(rhs.values.data(), rhs.values.size()); | 743 | 2 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE5mergeERKS2_ Line | Count | Source | 731 | 3 | void merge(const PercentileExactState& rhs) { | 732 | 3 | if (!rhs.inited_flag) { | 733 | 0 | return; | 734 | 0 | } | 735 | | | 736 | 3 | if (!inited_flag) { | 737 | 2 | levels = rhs.levels; | 738 | 2 | inited_flag = true; | 739 | 2 | } else { | 740 | 1 | levels.merge(rhs.levels); | 741 | 1 | } | 742 | 3 | _append(rhs.values.data(), rhs.values.size()); | 743 | 3 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE5mergeERKS2_ Line | Count | Source | 731 | 41 | void merge(const PercentileExactState& rhs) { | 732 | 41 | if (!rhs.inited_flag) { | 733 | 0 | return; | 734 | 0 | } | 735 | | | 736 | 41 | if (!inited_flag) { | 737 | 28 | levels = rhs.levels; | 738 | 28 | inited_flag = true; | 739 | 28 | } else { | 740 | 13 | levels.merge(rhs.levels); | 741 | 13 | } | 742 | 41 | _append(rhs.values.data(), rhs.values.size()); | 743 | 41 | } |
|
744 | | |
745 | 494 | void reset() { |
746 | 494 | values.clear(); |
747 | 494 | levels.clear(); |
748 | 494 | inited_flag = false; |
749 | 494 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE5resetEv Line | Count | Source | 745 | 2 | void reset() { | 746 | 2 | values.clear(); | 747 | 2 | levels.clear(); | 748 | 2 | inited_flag = false; | 749 | 2 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE5resetEv Line | Count | Source | 745 | 104 | void reset() { | 746 | 104 | values.clear(); | 747 | 104 | levels.clear(); | 748 | 104 | inited_flag = false; | 749 | 104 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE5resetEv Line | Count | Source | 745 | 244 | void reset() { | 746 | 244 | values.clear(); | 747 | 244 | levels.clear(); | 748 | 244 | inited_flag = false; | 749 | 244 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE5resetEv Line | Count | Source | 745 | 92 | void reset() { | 746 | 92 | values.clear(); | 747 | 92 | levels.clear(); | 748 | 92 | inited_flag = false; | 749 | 92 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE5resetEv Line | Count | Source | 745 | 2 | void reset() { | 746 | 2 | values.clear(); | 747 | 2 | levels.clear(); | 748 | 2 | inited_flag = false; | 749 | 2 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE5resetEv Line | Count | Source | 745 | 3 | void reset() { | 746 | 3 | values.clear(); | 747 | 3 | levels.clear(); | 748 | 3 | inited_flag = false; | 749 | 3 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE5resetEv Line | Count | Source | 745 | 47 | void reset() { | 746 | 47 | values.clear(); | 747 | 47 | levels.clear(); | 748 | 47 | inited_flag = false; | 749 | 47 | } |
|
750 | | |
751 | 375 | double get() const { |
752 | 375 | if (!inited_flag || levels.empty() || values.empty()) { |
753 | 3 | return std::numeric_limits<double>::quiet_NaN(); |
754 | 3 | } |
755 | | |
756 | 375 | DCHECK_EQ(levels.quantiles.size(), 1); |
757 | 372 | return _get_result(levels.quantiles[0]); |
758 | 375 | } _ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE3getEv Line | Count | Source | 751 | 30 | double get() const { | 752 | 30 | if (!inited_flag || levels.empty() || values.empty()) { | 753 | 1 | return std::numeric_limits<double>::quiet_NaN(); | 754 | 1 | } | 755 | | | 756 | 30 | DCHECK_EQ(levels.quantiles.size(), 1); | 757 | 29 | return _get_result(levels.quantiles[0]); | 758 | 30 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE3getEv Line | Count | Source | 751 | 177 | double get() const { | 752 | 177 | if (!inited_flag || levels.empty() || values.empty()) { | 753 | 0 | return std::numeric_limits<double>::quiet_NaN(); | 754 | 0 | } | 755 | | | 756 | 177 | DCHECK_EQ(levels.quantiles.size(), 1); | 757 | 177 | return _get_result(levels.quantiles[0]); | 758 | 177 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE3getEv Line | Count | Source | 751 | 63 | double get() const { | 752 | 63 | if (!inited_flag || levels.empty() || values.empty()) { | 753 | 0 | return std::numeric_limits<double>::quiet_NaN(); | 754 | 0 | } | 755 | | | 756 | 63 | DCHECK_EQ(levels.quantiles.size(), 1); | 757 | 63 | return _get_result(levels.quantiles[0]); | 758 | 63 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE3getEv Line | Count | Source | 751 | 67 | double get() const { | 752 | 67 | if (!inited_flag || levels.empty() || values.empty()) { | 753 | 1 | return std::numeric_limits<double>::quiet_NaN(); | 754 | 1 | } | 755 | | | 756 | 67 | DCHECK_EQ(levels.quantiles.size(), 1); | 757 | 66 | return _get_result(levels.quantiles[0]); | 758 | 67 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE3getEv Line | Count | Source | 751 | 1 | double get() const { | 752 | 1 | if (!inited_flag || levels.empty() || values.empty()) { | 753 | 0 | return std::numeric_limits<double>::quiet_NaN(); | 754 | 0 | } | 755 | | | 756 | 1 | DCHECK_EQ(levels.quantiles.size(), 1); | 757 | 1 | return _get_result(levels.quantiles[0]); | 758 | 1 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE3getEv Line | Count | Source | 751 | 2 | double get() const { | 752 | 2 | if (!inited_flag || levels.empty() || values.empty()) { | 753 | 0 | return std::numeric_limits<double>::quiet_NaN(); | 754 | 0 | } | 755 | | | 756 | 2 | DCHECK_EQ(levels.quantiles.size(), 1); | 757 | 2 | return _get_result(levels.quantiles[0]); | 758 | 2 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE3getEv Line | Count | Source | 751 | 35 | double get() const { | 752 | 35 | if (!inited_flag || levels.empty() || values.empty()) { | 753 | 1 | return std::numeric_limits<double>::quiet_NaN(); | 754 | 1 | } | 755 | | | 756 | 35 | DCHECK_EQ(levels.quantiles.size(), 1); | 757 | 34 | return _get_result(levels.quantiles[0]); | 758 | 35 | } |
|
759 | | |
760 | 276 | void insert_result_into(IColumn& to) const { |
761 | 276 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); |
762 | 276 | if (!inited_flag || levels.empty()) { |
763 | 10 | return; |
764 | 10 | } |
765 | | |
766 | 266 | size_t old_size = column_data.size(); |
767 | 266 | size_t size = levels.quantiles.size(); |
768 | 266 | column_data.resize(old_size + size); |
769 | 266 | auto* result = column_data.data() + old_size; |
770 | | |
771 | 266 | if (values.empty()) { |
772 | 4 | for (size_t i = 0; i < size; ++i) { |
773 | 3 | result[i] = std::numeric_limits<double>::quiet_NaN(); |
774 | 3 | } |
775 | 1 | return; |
776 | 1 | } |
777 | | |
778 | 265 | if (values.size() == 1) { |
779 | 452 | for (size_t i = 0; i < size; ++i) { |
780 | 320 | result[i] = static_cast<double>(values.front()); |
781 | 320 | } |
782 | 132 | return; |
783 | 132 | } |
784 | | |
785 | 133 | size_t prev_index = 0; |
786 | 133 | const auto& quantiles = levels.quantiles; |
787 | 133 | const auto& permutation = levels.get_permutation(); |
788 | 457 | for (size_t i = 0; i < size; ++i) { |
789 | 324 | auto level_index = permutation[i]; |
790 | 324 | auto level = quantiles[level_index]; |
791 | 324 | double u = static_cast<double>(values.size() - 1) * level; |
792 | 324 | auto index = static_cast<size_t>(u); |
793 | | |
794 | 324 | if (index + 1 >= values.size()) { |
795 | 0 | result[level_index] = |
796 | 0 | static_cast<double>(*std::max_element(values.begin(), values.end())); |
797 | 324 | } else { |
798 | 324 | std::nth_element(values.begin() + prev_index, values.begin() + index, values.end()); |
799 | 324 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); |
800 | 324 | result[level_index] = |
801 | 324 | static_cast<double>(values[index]) + |
802 | 324 | (u - static_cast<double>(index)) * (static_cast<double>(*nth_elem) - |
803 | 324 | static_cast<double>(values[index])); |
804 | 324 | prev_index = index; |
805 | 324 | } |
806 | 324 | } |
807 | 133 | } _ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 760 | 12 | void insert_result_into(IColumn& to) const { | 761 | 12 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); | 762 | 12 | if (!inited_flag || levels.empty()) { | 763 | 1 | return; | 764 | 1 | } | 765 | | | 766 | 11 | size_t old_size = column_data.size(); | 767 | 11 | size_t size = levels.quantiles.size(); | 768 | 11 | column_data.resize(old_size + size); | 769 | 11 | auto* result = column_data.data() + old_size; | 770 | | | 771 | 11 | if (values.empty()) { | 772 | 0 | for (size_t i = 0; i < size; ++i) { | 773 | 0 | result[i] = std::numeric_limits<double>::quiet_NaN(); | 774 | 0 | } | 775 | 0 | return; | 776 | 0 | } | 777 | | | 778 | 11 | if (values.size() == 1) { | 779 | 32 | for (size_t i = 0; i < size; ++i) { | 780 | 24 | result[i] = static_cast<double>(values.front()); | 781 | 24 | } | 782 | 8 | return; | 783 | 8 | } | 784 | | | 785 | 3 | size_t prev_index = 0; | 786 | 3 | const auto& quantiles = levels.quantiles; | 787 | 3 | const auto& permutation = levels.get_permutation(); | 788 | 11 | for (size_t i = 0; i < size; ++i) { | 789 | 8 | auto level_index = permutation[i]; | 790 | 8 | auto level = quantiles[level_index]; | 791 | 8 | double u = static_cast<double>(values.size() - 1) * level; | 792 | 8 | auto index = static_cast<size_t>(u); | 793 | | | 794 | 8 | if (index + 1 >= values.size()) { | 795 | 0 | result[level_index] = | 796 | 0 | static_cast<double>(*std::max_element(values.begin(), values.end())); | 797 | 8 | } else { | 798 | 8 | std::nth_element(values.begin() + prev_index, values.begin() + index, values.end()); | 799 | 8 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 800 | 8 | result[level_index] = | 801 | 8 | static_cast<double>(values[index]) + | 802 | 8 | (u - static_cast<double>(index)) * (static_cast<double>(*nth_elem) - | 803 | 8 | static_cast<double>(values[index])); | 804 | 8 | prev_index = index; | 805 | 8 | } | 806 | 8 | } | 807 | 3 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 760 | 13 | void insert_result_into(IColumn& to) const { | 761 | 13 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); | 762 | 13 | if (!inited_flag || levels.empty()) { | 763 | 1 | return; | 764 | 1 | } | 765 | | | 766 | 12 | size_t old_size = column_data.size(); | 767 | 12 | size_t size = levels.quantiles.size(); | 768 | 12 | column_data.resize(old_size + size); | 769 | 12 | auto* result = column_data.data() + old_size; | 770 | | | 771 | 12 | if (values.empty()) { | 772 | 0 | for (size_t i = 0; i < size; ++i) { | 773 | 0 | result[i] = std::numeric_limits<double>::quiet_NaN(); | 774 | 0 | } | 775 | 0 | return; | 776 | 0 | } | 777 | | | 778 | 12 | if (values.size() == 1) { | 779 | 32 | for (size_t i = 0; i < size; ++i) { | 780 | 24 | result[i] = static_cast<double>(values.front()); | 781 | 24 | } | 782 | 8 | return; | 783 | 8 | } | 784 | | | 785 | 4 | size_t prev_index = 0; | 786 | 4 | const auto& quantiles = levels.quantiles; | 787 | 4 | const auto& permutation = levels.get_permutation(); | 788 | 15 | for (size_t i = 0; i < size; ++i) { | 789 | 11 | auto level_index = permutation[i]; | 790 | 11 | auto level = quantiles[level_index]; | 791 | 11 | double u = static_cast<double>(values.size() - 1) * level; | 792 | 11 | auto index = static_cast<size_t>(u); | 793 | | | 794 | 11 | if (index + 1 >= values.size()) { | 795 | 0 | result[level_index] = | 796 | 0 | static_cast<double>(*std::max_element(values.begin(), values.end())); | 797 | 11 | } else { | 798 | 11 | std::nth_element(values.begin() + prev_index, values.begin() + index, values.end()); | 799 | 11 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 800 | 11 | result[level_index] = | 801 | 11 | static_cast<double>(values[index]) + | 802 | 11 | (u - static_cast<double>(index)) * (static_cast<double>(*nth_elem) - | 803 | 11 | static_cast<double>(values[index])); | 804 | 11 | prev_index = index; | 805 | 11 | } | 806 | 11 | } | 807 | 4 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 760 | 180 | void insert_result_into(IColumn& to) const { | 761 | 180 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); | 762 | 180 | if (!inited_flag || levels.empty()) { | 763 | 4 | return; | 764 | 4 | } | 765 | | | 766 | 176 | size_t old_size = column_data.size(); | 767 | 176 | size_t size = levels.quantiles.size(); | 768 | 176 | column_data.resize(old_size + size); | 769 | 176 | auto* result = column_data.data() + old_size; | 770 | | | 771 | 176 | if (values.empty()) { | 772 | 0 | for (size_t i = 0; i < size; ++i) { | 773 | 0 | result[i] = std::numeric_limits<double>::quiet_NaN(); | 774 | 0 | } | 775 | 0 | return; | 776 | 0 | } | 777 | | | 778 | 176 | if (values.size() == 1) { | 779 | 297 | for (size_t i = 0; i < size; ++i) { | 780 | 206 | result[i] = static_cast<double>(values.front()); | 781 | 206 | } | 782 | 91 | return; | 783 | 91 | } | 784 | | | 785 | 85 | size_t prev_index = 0; | 786 | 85 | const auto& quantiles = levels.quantiles; | 787 | 85 | const auto& permutation = levels.get_permutation(); | 788 | 281 | for (size_t i = 0; i < size; ++i) { | 789 | 196 | auto level_index = permutation[i]; | 790 | 196 | auto level = quantiles[level_index]; | 791 | 196 | double u = static_cast<double>(values.size() - 1) * level; | 792 | 196 | auto index = static_cast<size_t>(u); | 793 | | | 794 | 196 | if (index + 1 >= values.size()) { | 795 | 0 | result[level_index] = | 796 | 0 | static_cast<double>(*std::max_element(values.begin(), values.end())); | 797 | 196 | } else { | 798 | 196 | std::nth_element(values.begin() + prev_index, values.begin() + index, values.end()); | 799 | 196 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 800 | 196 | result[level_index] = | 801 | 196 | static_cast<double>(values[index]) + | 802 | 196 | (u - static_cast<double>(index)) * (static_cast<double>(*nth_elem) - | 803 | 196 | static_cast<double>(values[index])); | 804 | 196 | prev_index = index; | 805 | 196 | } | 806 | 196 | } | 807 | 85 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 760 | 13 | void insert_result_into(IColumn& to) const { | 761 | 13 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); | 762 | 13 | if (!inited_flag || levels.empty()) { | 763 | 1 | return; | 764 | 1 | } | 765 | | | 766 | 12 | size_t old_size = column_data.size(); | 767 | 12 | size_t size = levels.quantiles.size(); | 768 | 12 | column_data.resize(old_size + size); | 769 | 12 | auto* result = column_data.data() + old_size; | 770 | | | 771 | 12 | if (values.empty()) { | 772 | 0 | for (size_t i = 0; i < size; ++i) { | 773 | 0 | result[i] = std::numeric_limits<double>::quiet_NaN(); | 774 | 0 | } | 775 | 0 | return; | 776 | 0 | } | 777 | | | 778 | 12 | if (values.size() == 1) { | 779 | 32 | for (size_t i = 0; i < size; ++i) { | 780 | 24 | result[i] = static_cast<double>(values.front()); | 781 | 24 | } | 782 | 8 | return; | 783 | 8 | } | 784 | | | 785 | 4 | size_t prev_index = 0; | 786 | 4 | const auto& quantiles = levels.quantiles; | 787 | 4 | const auto& permutation = levels.get_permutation(); | 788 | 15 | for (size_t i = 0; i < size; ++i) { | 789 | 11 | auto level_index = permutation[i]; | 790 | 11 | auto level = quantiles[level_index]; | 791 | 11 | double u = static_cast<double>(values.size() - 1) * level; | 792 | 11 | auto index = static_cast<size_t>(u); | 793 | | | 794 | 11 | if (index + 1 >= values.size()) { | 795 | 0 | result[level_index] = | 796 | 0 | static_cast<double>(*std::max_element(values.begin(), values.end())); | 797 | 11 | } else { | 798 | 11 | std::nth_element(values.begin() + prev_index, values.begin() + index, values.end()); | 799 | 11 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 800 | 11 | result[level_index] = | 801 | 11 | static_cast<double>(values[index]) + | 802 | 11 | (u - static_cast<double>(index)) * (static_cast<double>(*nth_elem) - | 803 | 11 | static_cast<double>(values[index])); | 804 | 11 | prev_index = index; | 805 | 11 | } | 806 | 11 | } | 807 | 4 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 760 | 12 | void insert_result_into(IColumn& to) const { | 761 | 12 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); | 762 | 12 | if (!inited_flag || levels.empty()) { | 763 | 1 | return; | 764 | 1 | } | 765 | | | 766 | 11 | size_t old_size = column_data.size(); | 767 | 11 | size_t size = levels.quantiles.size(); | 768 | 11 | column_data.resize(old_size + size); | 769 | 11 | auto* result = column_data.data() + old_size; | 770 | | | 771 | 11 | if (values.empty()) { | 772 | 0 | for (size_t i = 0; i < size; ++i) { | 773 | 0 | result[i] = std::numeric_limits<double>::quiet_NaN(); | 774 | 0 | } | 775 | 0 | return; | 776 | 0 | } | 777 | | | 778 | 11 | if (values.size() == 1) { | 779 | 32 | for (size_t i = 0; i < size; ++i) { | 780 | 24 | result[i] = static_cast<double>(values.front()); | 781 | 24 | } | 782 | 8 | return; | 783 | 8 | } | 784 | | | 785 | 3 | size_t prev_index = 0; | 786 | 3 | const auto& quantiles = levels.quantiles; | 787 | 3 | const auto& permutation = levels.get_permutation(); | 788 | 11 | for (size_t i = 0; i < size; ++i) { | 789 | 8 | auto level_index = permutation[i]; | 790 | 8 | auto level = quantiles[level_index]; | 791 | 8 | double u = static_cast<double>(values.size() - 1) * level; | 792 | 8 | auto index = static_cast<size_t>(u); | 793 | | | 794 | 8 | if (index + 1 >= values.size()) { | 795 | 0 | result[level_index] = | 796 | 0 | static_cast<double>(*std::max_element(values.begin(), values.end())); | 797 | 8 | } else { | 798 | 8 | std::nth_element(values.begin() + prev_index, values.begin() + index, values.end()); | 799 | 8 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 800 | 8 | result[level_index] = | 801 | 8 | static_cast<double>(values[index]) + | 802 | 8 | (u - static_cast<double>(index)) * (static_cast<double>(*nth_elem) - | 803 | 8 | static_cast<double>(values[index])); | 804 | 8 | prev_index = index; | 805 | 8 | } | 806 | 8 | } | 807 | 3 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 760 | 2 | void insert_result_into(IColumn& to) const { | 761 | 2 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); | 762 | 2 | if (!inited_flag || levels.empty()) { | 763 | 1 | return; | 764 | 1 | } | 765 | | | 766 | 1 | size_t old_size = column_data.size(); | 767 | 1 | size_t size = levels.quantiles.size(); | 768 | 1 | column_data.resize(old_size + size); | 769 | 1 | auto* result = column_data.data() + old_size; | 770 | | | 771 | 1 | if (values.empty()) { | 772 | 0 | for (size_t i = 0; i < size; ++i) { | 773 | 0 | result[i] = std::numeric_limits<double>::quiet_NaN(); | 774 | 0 | } | 775 | 0 | return; | 776 | 0 | } | 777 | | | 778 | 1 | if (values.size() == 1) { | 779 | 0 | for (size_t i = 0; i < size; ++i) { | 780 | 0 | result[i] = static_cast<double>(values.front()); | 781 | 0 | } | 782 | 0 | return; | 783 | 0 | } | 784 | | | 785 | 1 | size_t prev_index = 0; | 786 | 1 | const auto& quantiles = levels.quantiles; | 787 | 1 | const auto& permutation = levels.get_permutation(); | 788 | 3 | for (size_t i = 0; i < size; ++i) { | 789 | 2 | auto level_index = permutation[i]; | 790 | 2 | auto level = quantiles[level_index]; | 791 | 2 | double u = static_cast<double>(values.size() - 1) * level; | 792 | 2 | auto index = static_cast<size_t>(u); | 793 | | | 794 | 2 | if (index + 1 >= values.size()) { | 795 | 0 | result[level_index] = | 796 | 0 | static_cast<double>(*std::max_element(values.begin(), values.end())); | 797 | 2 | } else { | 798 | 2 | std::nth_element(values.begin() + prev_index, values.begin() + index, values.end()); | 799 | 2 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 800 | 2 | result[level_index] = | 801 | 2 | static_cast<double>(values[index]) + | 802 | 2 | (u - static_cast<double>(index)) * (static_cast<double>(*nth_elem) - | 803 | 2 | static_cast<double>(values[index])); | 804 | 2 | prev_index = index; | 805 | 2 | } | 806 | 2 | } | 807 | 1 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 760 | 44 | void insert_result_into(IColumn& to) const { | 761 | 44 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); | 762 | 44 | if (!inited_flag || levels.empty()) { | 763 | 1 | return; | 764 | 1 | } | 765 | | | 766 | 43 | size_t old_size = column_data.size(); | 767 | 43 | size_t size = levels.quantiles.size(); | 768 | 43 | column_data.resize(old_size + size); | 769 | 43 | auto* result = column_data.data() + old_size; | 770 | | | 771 | 43 | if (values.empty()) { | 772 | 4 | for (size_t i = 0; i < size; ++i) { | 773 | 3 | result[i] = std::numeric_limits<double>::quiet_NaN(); | 774 | 3 | } | 775 | 1 | return; | 776 | 1 | } | 777 | | | 778 | 42 | if (values.size() == 1) { | 779 | 27 | for (size_t i = 0; i < size; ++i) { | 780 | 18 | result[i] = static_cast<double>(values.front()); | 781 | 18 | } | 782 | 9 | return; | 783 | 9 | } | 784 | | | 785 | 33 | size_t prev_index = 0; | 786 | 33 | const auto& quantiles = levels.quantiles; | 787 | 33 | const auto& permutation = levels.get_permutation(); | 788 | 121 | for (size_t i = 0; i < size; ++i) { | 789 | 88 | auto level_index = permutation[i]; | 790 | 88 | auto level = quantiles[level_index]; | 791 | 88 | double u = static_cast<double>(values.size() - 1) * level; | 792 | 88 | auto index = static_cast<size_t>(u); | 793 | | | 794 | 88 | if (index + 1 >= values.size()) { | 795 | 0 | result[level_index] = | 796 | 0 | static_cast<double>(*std::max_element(values.begin(), values.end())); | 797 | 88 | } else { | 798 | 88 | std::nth_element(values.begin() + prev_index, values.begin() + index, values.end()); | 799 | 88 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 800 | 88 | result[level_index] = | 801 | 88 | static_cast<double>(values[index]) + | 802 | 88 | (u - static_cast<double>(index)) * (static_cast<double>(*nth_elem) - | 803 | 88 | static_cast<double>(values[index])); | 804 | 88 | prev_index = index; | 805 | 88 | } | 806 | 88 | } | 807 | 33 | } |
|
808 | | |
809 | | private: |
810 | 329 | void _set_single_level(double quantile) { |
811 | 329 | DCHECK(levels.empty()); |
812 | 329 | check_quantile(quantile); |
813 | 329 | levels.quantiles.push_back(quantile); |
814 | 329 | levels.permutation.push_back(0); |
815 | 329 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE17_set_single_levelEd Line | Count | Source | 810 | 6 | void _set_single_level(double quantile) { | 811 | | DCHECK(levels.empty()); | 812 | 6 | check_quantile(quantile); | 813 | 6 | levels.quantiles.push_back(quantile); | 814 | 6 | levels.permutation.push_back(0); | 815 | 6 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE17_set_single_levelEd Line | Count | Source | 810 | 100 | void _set_single_level(double quantile) { | 811 | | DCHECK(levels.empty()); | 812 | 100 | check_quantile(quantile); | 813 | 100 | levels.quantiles.push_back(quantile); | 814 | 100 | levels.permutation.push_back(0); | 815 | 100 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE17_set_single_levelEd Line | Count | Source | 810 | 79 | void _set_single_level(double quantile) { | 811 | | DCHECK(levels.empty()); | 812 | 79 | check_quantile(quantile); | 813 | 79 | levels.quantiles.push_back(quantile); | 814 | 79 | levels.permutation.push_back(0); | 815 | 79 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE17_set_single_levelEd Line | Count | Source | 810 | 112 | void _set_single_level(double quantile) { | 811 | | DCHECK(levels.empty()); | 812 | 112 | check_quantile(quantile); | 813 | 112 | levels.quantiles.push_back(quantile); | 814 | 112 | levels.permutation.push_back(0); | 815 | 112 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE17_set_single_levelEd Line | Count | Source | 810 | 2 | void _set_single_level(double quantile) { | 811 | | DCHECK(levels.empty()); | 812 | 2 | check_quantile(quantile); | 813 | 2 | levels.quantiles.push_back(quantile); | 814 | 2 | levels.permutation.push_back(0); | 815 | 2 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE17_set_single_levelEd Line | Count | Source | 810 | 3 | void _set_single_level(double quantile) { | 811 | | DCHECK(levels.empty()); | 812 | 3 | check_quantile(quantile); | 813 | 3 | levels.quantiles.push_back(quantile); | 814 | 3 | levels.permutation.push_back(0); | 815 | 3 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE17_set_single_levelEd Line | Count | Source | 810 | 27 | void _set_single_level(double quantile) { | 811 | | DCHECK(levels.empty()); | 812 | 27 | check_quantile(quantile); | 813 | 27 | levels.quantiles.push_back(quantile); | 814 | 27 | levels.permutation.push_back(0); | 815 | 27 | } |
|
816 | | |
817 | | void _set_many_levels(const PaddedPODArray<Float64>& quantiles_data, const NullMap& null_maps, |
818 | 317 | size_t start, int64_t arg_size) { |
819 | 317 | DCHECK(levels.empty()); |
820 | 317 | size_t size = cast_set<size_t>(arg_size); |
821 | 317 | levels.quantiles.resize(size); |
822 | 317 | levels.permutation.resize(size); |
823 | 1.05k | for (size_t i = 0; i < size; ++i) { |
824 | 738 | if (null_maps[start + i]) { |
825 | 1 | throw Exception(ErrorCode::INVALID_ARGUMENT, |
826 | 1 | "quantiles in func percentile_array should not have null"); |
827 | 1 | } |
828 | 737 | check_quantile(quantiles_data[start + i]); |
829 | 737 | levels.quantiles[i] = quantiles_data[start + i]; |
830 | 737 | levels.permutation[i] = i; |
831 | 737 | } |
832 | 317 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 11 | size_t start, int64_t arg_size) { | 819 | 11 | DCHECK(levels.empty()); | 820 | 11 | size_t size = cast_set<size_t>(arg_size); | 821 | 11 | levels.quantiles.resize(size); | 822 | 11 | levels.permutation.resize(size); | 823 | 43 | for (size_t i = 0; i < size; ++i) { | 824 | 32 | if (null_maps[start + i]) { | 825 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 826 | 0 | "quantiles in func percentile_array should not have null"); | 827 | 0 | } | 828 | 32 | check_quantile(quantiles_data[start + i]); | 829 | 32 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 32 | levels.permutation[i] = i; | 831 | 32 | } | 832 | 11 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 12 | size_t start, int64_t arg_size) { | 819 | 12 | DCHECK(levels.empty()); | 820 | 12 | size_t size = cast_set<size_t>(arg_size); | 821 | 12 | levels.quantiles.resize(size); | 822 | 12 | levels.permutation.resize(size); | 823 | 47 | for (size_t i = 0; i < size; ++i) { | 824 | 35 | if (null_maps[start + i]) { | 825 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 826 | 0 | "quantiles in func percentile_array should not have null"); | 827 | 0 | } | 828 | 35 | check_quantile(quantiles_data[start + i]); | 829 | 35 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 35 | levels.permutation[i] = i; | 831 | 35 | } | 832 | 12 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 226 | size_t start, int64_t arg_size) { | 819 | 226 | DCHECK(levels.empty()); | 820 | 226 | size_t size = cast_set<size_t>(arg_size); | 821 | 226 | levels.quantiles.resize(size); | 822 | 226 | levels.permutation.resize(size); | 823 | 730 | for (size_t i = 0; i < size; ++i) { | 824 | 504 | if (null_maps[start + i]) { | 825 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 826 | 0 | "quantiles in func percentile_array should not have null"); | 827 | 0 | } | 828 | 504 | check_quantile(quantiles_data[start + i]); | 829 | 504 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 504 | levels.permutation[i] = i; | 831 | 504 | } | 832 | 226 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 15 | size_t start, int64_t arg_size) { | 819 | 15 | DCHECK(levels.empty()); | 820 | 15 | size_t size = cast_set<size_t>(arg_size); | 821 | 15 | levels.quantiles.resize(size); | 822 | 15 | levels.permutation.resize(size); | 823 | 56 | for (size_t i = 0; i < size; ++i) { | 824 | 42 | if (null_maps[start + i]) { | 825 | 1 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 826 | 1 | "quantiles in func percentile_array should not have null"); | 827 | 1 | } | 828 | 41 | check_quantile(quantiles_data[start + i]); | 829 | 41 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 41 | levels.permutation[i] = i; | 831 | 41 | } | 832 | 15 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 11 | size_t start, int64_t arg_size) { | 819 | 11 | DCHECK(levels.empty()); | 820 | 11 | size_t size = cast_set<size_t>(arg_size); | 821 | 11 | levels.quantiles.resize(size); | 822 | 11 | levels.permutation.resize(size); | 823 | 43 | for (size_t i = 0; i < size; ++i) { | 824 | 32 | if (null_maps[start + i]) { | 825 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 826 | 0 | "quantiles in func percentile_array should not have null"); | 827 | 0 | } | 828 | 32 | check_quantile(quantiles_data[start + i]); | 829 | 32 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 32 | levels.permutation[i] = i; | 831 | 32 | } | 832 | 11 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 1 | size_t start, int64_t arg_size) { | 819 | 1 | DCHECK(levels.empty()); | 820 | 1 | size_t size = cast_set<size_t>(arg_size); | 821 | 1 | levels.quantiles.resize(size); | 822 | 1 | levels.permutation.resize(size); | 823 | 3 | for (size_t i = 0; i < size; ++i) { | 824 | 2 | if (null_maps[start + i]) { | 825 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 826 | 0 | "quantiles in func percentile_array should not have null"); | 827 | 0 | } | 828 | 2 | check_quantile(quantiles_data[start + i]); | 829 | 2 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 2 | levels.permutation[i] = i; | 831 | 2 | } | 832 | 1 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 41 | size_t start, int64_t arg_size) { | 819 | 41 | DCHECK(levels.empty()); | 820 | 41 | size_t size = cast_set<size_t>(arg_size); | 821 | 41 | levels.quantiles.resize(size); | 822 | 41 | levels.permutation.resize(size); | 823 | 132 | for (size_t i = 0; i < size; ++i) { | 824 | 91 | if (null_maps[start + i]) { | 825 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 826 | 0 | "quantiles in func percentile_array should not have null"); | 827 | 0 | } | 828 | 91 | check_quantile(quantiles_data[start + i]); | 829 | 91 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 91 | levels.permutation[i] = i; | 831 | 91 | } | 832 | 41 | } |
|
833 | | |
834 | 1.92k | void _append(const ValueType* data, size_t count) { |
835 | 1.92k | if (count == 0) { |
836 | 2 | return; |
837 | 2 | } |
838 | 1.92k | values.reserve(values.size() + count); |
839 | 1.92k | if constexpr (std::is_floating_point_v<ValueType>) { |
840 | 400 | for (size_t i = 0; i < count; ++i) { |
841 | 217 | if (!std::isnan(data[i])) { |
842 | 210 | values.push_back(data[i]); |
843 | 210 | } |
844 | 217 | } |
845 | 1.74k | } else { |
846 | 1.74k | values.insert_assume_reserved(data, data + count); |
847 | 1.74k | } |
848 | 1.92k | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE7_appendEPKam Line | Count | Source | 834 | 48 | void _append(const ValueType* data, size_t count) { | 835 | 48 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 48 | values.reserve(values.size() + count); | 839 | | if constexpr (std::is_floating_point_v<ValueType>) { | 840 | | for (size_t i = 0; i < count; ++i) { | 841 | | if (!std::isnan(data[i])) { | 842 | | values.push_back(data[i]); | 843 | | } | 844 | | } | 845 | 48 | } else { | 846 | 48 | values.insert_assume_reserved(data, data + count); | 847 | 48 | } | 848 | 48 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE7_appendEPKsm Line | Count | Source | 834 | 343 | void _append(const ValueType* data, size_t count) { | 835 | 343 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 343 | values.reserve(values.size() + count); | 839 | | if constexpr (std::is_floating_point_v<ValueType>) { | 840 | | for (size_t i = 0; i < count; ++i) { | 841 | | if (!std::isnan(data[i])) { | 842 | | values.push_back(data[i]); | 843 | | } | 844 | | } | 845 | 343 | } else { | 846 | 343 | values.insert_assume_reserved(data, data + count); | 847 | 343 | } | 848 | 343 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE7_appendEPKim Line | Count | Source | 834 | 1.01k | void _append(const ValueType* data, size_t count) { | 835 | 1.01k | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 1.01k | values.reserve(values.size() + count); | 839 | | if constexpr (std::is_floating_point_v<ValueType>) { | 840 | | for (size_t i = 0; i < count; ++i) { | 841 | | if (!std::isnan(data[i])) { | 842 | | values.push_back(data[i]); | 843 | | } | 844 | | } | 845 | 1.01k | } else { | 846 | 1.01k | values.insert_assume_reserved(data, data + count); | 847 | 1.01k | } | 848 | 1.01k | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE7_appendEPKlm Line | Count | Source | 834 | 319 | void _append(const ValueType* data, size_t count) { | 835 | 319 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 319 | values.reserve(values.size() + count); | 839 | | if constexpr (std::is_floating_point_v<ValueType>) { | 840 | | for (size_t i = 0; i < count; ++i) { | 841 | | if (!std::isnan(data[i])) { | 842 | | values.push_back(data[i]); | 843 | | } | 844 | | } | 845 | 319 | } else { | 846 | 319 | values.insert_assume_reserved(data, data + count); | 847 | 319 | } | 848 | 319 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE7_appendEPKnm Line | Count | Source | 834 | 20 | void _append(const ValueType* data, size_t count) { | 835 | 20 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 20 | values.reserve(values.size() + count); | 839 | | if constexpr (std::is_floating_point_v<ValueType>) { | 840 | | for (size_t i = 0; i < count; ++i) { | 841 | | if (!std::isnan(data[i])) { | 842 | | values.push_back(data[i]); | 843 | | } | 844 | | } | 845 | 20 | } else { | 846 | 20 | values.insert_assume_reserved(data, data + count); | 847 | 20 | } | 848 | 20 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE7_appendEPKfm Line | Count | Source | 834 | 12 | void _append(const ValueType* data, size_t count) { | 835 | 12 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 12 | values.reserve(values.size() + count); | 839 | 12 | if constexpr (std::is_floating_point_v<ValueType>) { | 840 | 26 | for (size_t i = 0; i < count; ++i) { | 841 | 14 | if (!std::isnan(data[i])) { | 842 | 13 | values.push_back(data[i]); | 843 | 13 | } | 844 | 14 | } | 845 | | } else { | 846 | | values.insert_assume_reserved(data, data + count); | 847 | | } | 848 | 12 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE7_appendEPKdm Line | Count | Source | 834 | 173 | void _append(const ValueType* data, size_t count) { | 835 | 173 | if (count == 0) { | 836 | 2 | return; | 837 | 2 | } | 838 | 171 | values.reserve(values.size() + count); | 839 | 171 | if constexpr (std::is_floating_point_v<ValueType>) { | 840 | 374 | for (size_t i = 0; i < count; ++i) { | 841 | 203 | if (!std::isnan(data[i])) { | 842 | 197 | values.push_back(data[i]); | 843 | 197 | } | 844 | 203 | } | 845 | | } else { | 846 | | values.insert_assume_reserved(data, data + count); | 847 | | } | 848 | 171 | } |
|
849 | | |
850 | 372 | double _get_result(double quantile) const { |
851 | 372 | if (values.size() == 1) { |
852 | 114 | return static_cast<double>(values.front()); |
853 | 114 | } |
854 | | |
855 | 258 | double u = static_cast<double>(values.size() - 1) * quantile; |
856 | 258 | auto index = static_cast<size_t>(u); |
857 | | |
858 | 258 | if (index + 1 >= values.size()) { |
859 | 6 | return static_cast<double>(*std::max_element(values.begin(), values.end())); |
860 | 6 | } |
861 | | |
862 | 252 | std::nth_element(values.begin(), values.begin() + index, values.end()); |
863 | 252 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); |
864 | | |
865 | 252 | return static_cast<double>(values[index]) + |
866 | 252 | (u - static_cast<double>(index)) * |
867 | 252 | (static_cast<double>(*nth_elem) - static_cast<double>(values[index])); |
868 | 258 | } _ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE11_get_resultEd Line | Count | Source | 850 | 29 | double _get_result(double quantile) const { | 851 | 29 | if (values.size() == 1) { | 852 | 4 | return static_cast<double>(values.front()); | 853 | 4 | } | 854 | | | 855 | 25 | double u = static_cast<double>(values.size() - 1) * quantile; | 856 | 25 | auto index = static_cast<size_t>(u); | 857 | | | 858 | 25 | if (index + 1 >= values.size()) { | 859 | 6 | return static_cast<double>(*std::max_element(values.begin(), values.end())); | 860 | 6 | } | 861 | | | 862 | 19 | std::nth_element(values.begin(), values.begin() + index, values.end()); | 863 | 19 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 864 | | | 865 | 19 | return static_cast<double>(values[index]) + | 866 | 19 | (u - static_cast<double>(index)) * | 867 | 19 | (static_cast<double>(*nth_elem) - static_cast<double>(values[index])); | 868 | 25 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE11_get_resultEd Line | Count | Source | 850 | 177 | double _get_result(double quantile) const { | 851 | 177 | if (values.size() == 1) { | 852 | 42 | return static_cast<double>(values.front()); | 853 | 42 | } | 854 | | | 855 | 135 | double u = static_cast<double>(values.size() - 1) * quantile; | 856 | 135 | auto index = static_cast<size_t>(u); | 857 | | | 858 | 135 | if (index + 1 >= values.size()) { | 859 | 0 | return static_cast<double>(*std::max_element(values.begin(), values.end())); | 860 | 0 | } | 861 | | | 862 | 135 | std::nth_element(values.begin(), values.begin() + index, values.end()); | 863 | 135 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 864 | | | 865 | 135 | return static_cast<double>(values[index]) + | 866 | 135 | (u - static_cast<double>(index)) * | 867 | 135 | (static_cast<double>(*nth_elem) - static_cast<double>(values[index])); | 868 | 135 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE11_get_resultEd Line | Count | Source | 850 | 63 | double _get_result(double quantile) const { | 851 | 63 | if (values.size() == 1) { | 852 | 21 | return static_cast<double>(values.front()); | 853 | 21 | } | 854 | | | 855 | 42 | double u = static_cast<double>(values.size() - 1) * quantile; | 856 | 42 | auto index = static_cast<size_t>(u); | 857 | | | 858 | 42 | if (index + 1 >= values.size()) { | 859 | 0 | return static_cast<double>(*std::max_element(values.begin(), values.end())); | 860 | 0 | } | 861 | | | 862 | 42 | std::nth_element(values.begin(), values.begin() + index, values.end()); | 863 | 42 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 864 | | | 865 | 42 | return static_cast<double>(values[index]) + | 866 | 42 | (u - static_cast<double>(index)) * | 867 | 42 | (static_cast<double>(*nth_elem) - static_cast<double>(values[index])); | 868 | 42 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE11_get_resultEd Line | Count | Source | 850 | 66 | double _get_result(double quantile) const { | 851 | 66 | if (values.size() == 1) { | 852 | 35 | return static_cast<double>(values.front()); | 853 | 35 | } | 854 | | | 855 | 31 | double u = static_cast<double>(values.size() - 1) * quantile; | 856 | 31 | auto index = static_cast<size_t>(u); | 857 | | | 858 | 31 | if (index + 1 >= values.size()) { | 859 | 0 | return static_cast<double>(*std::max_element(values.begin(), values.end())); | 860 | 0 | } | 861 | | | 862 | 31 | std::nth_element(values.begin(), values.begin() + index, values.end()); | 863 | 31 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 864 | | | 865 | 31 | return static_cast<double>(values[index]) + | 866 | 31 | (u - static_cast<double>(index)) * | 867 | 31 | (static_cast<double>(*nth_elem) - static_cast<double>(values[index])); | 868 | 31 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE11_get_resultEd Line | Count | Source | 850 | 1 | double _get_result(double quantile) const { | 851 | 1 | if (values.size() == 1) { | 852 | 0 | return static_cast<double>(values.front()); | 853 | 0 | } | 854 | | | 855 | 1 | double u = static_cast<double>(values.size() - 1) * quantile; | 856 | 1 | auto index = static_cast<size_t>(u); | 857 | | | 858 | 1 | if (index + 1 >= values.size()) { | 859 | 0 | return static_cast<double>(*std::max_element(values.begin(), values.end())); | 860 | 0 | } | 861 | | | 862 | 1 | std::nth_element(values.begin(), values.begin() + index, values.end()); | 863 | 1 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 864 | | | 865 | 1 | return static_cast<double>(values[index]) + | 866 | 1 | (u - static_cast<double>(index)) * | 867 | 1 | (static_cast<double>(*nth_elem) - static_cast<double>(values[index])); | 868 | 1 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE11_get_resultEd Line | Count | Source | 850 | 2 | double _get_result(double quantile) const { | 851 | 2 | if (values.size() == 1) { | 852 | 0 | return static_cast<double>(values.front()); | 853 | 0 | } | 854 | | | 855 | 2 | double u = static_cast<double>(values.size() - 1) * quantile; | 856 | 2 | auto index = static_cast<size_t>(u); | 857 | | | 858 | 2 | if (index + 1 >= values.size()) { | 859 | 0 | return static_cast<double>(*std::max_element(values.begin(), values.end())); | 860 | 0 | } | 861 | | | 862 | 2 | std::nth_element(values.begin(), values.begin() + index, values.end()); | 863 | 2 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 864 | | | 865 | 2 | return static_cast<double>(values[index]) + | 866 | 2 | (u - static_cast<double>(index)) * | 867 | 2 | (static_cast<double>(*nth_elem) - static_cast<double>(values[index])); | 868 | 2 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE11_get_resultEd Line | Count | Source | 850 | 34 | double _get_result(double quantile) const { | 851 | 34 | if (values.size() == 1) { | 852 | 12 | return static_cast<double>(values.front()); | 853 | 12 | } | 854 | | | 855 | 22 | double u = static_cast<double>(values.size() - 1) * quantile; | 856 | 22 | auto index = static_cast<size_t>(u); | 857 | | | 858 | 22 | if (index + 1 >= values.size()) { | 859 | 0 | return static_cast<double>(*std::max_element(values.begin(), values.end())); | 860 | 0 | } | 861 | | | 862 | 22 | std::nth_element(values.begin(), values.begin() + index, values.end()); | 863 | 22 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 864 | | | 865 | 22 | return static_cast<double>(values[index]) + | 866 | 22 | (u - static_cast<double>(index)) * | 867 | 22 | (static_cast<double>(*nth_elem) - static_cast<double>(values[index])); | 868 | 22 | } |
|
869 | | |
870 | | mutable Array values; |
871 | | mutable PercentileLevels levels; |
872 | | bool inited_flag = false; |
873 | | }; |
874 | | |
875 | | template <PrimitiveType T> |
876 | | class AggregateFunctionPercentile final |
877 | | : public IAggregateFunctionDataHelper<PercentileState<T>, AggregateFunctionPercentile<T>>, |
878 | | MultiExpression, |
879 | | NullableAggregateFunction { |
880 | | public: |
881 | | using ColVecType = typename PrimitiveTypeTraits<T>::ColumnType; |
882 | | using Base = IAggregateFunctionDataHelper<PercentileState<T>, AggregateFunctionPercentile<T>>; |
883 | 1.35k | AggregateFunctionPercentile(const DataTypes& argument_types_) : Base(argument_types_) {}Unexecuted instantiation: _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 883 | 1.35k | AggregateFunctionPercentile(const DataTypes& argument_types_) : Base(argument_types_) {} |
Unexecuted instantiation: _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE |
884 | | |
885 | 129 | String get_name() const override { return "percentile"; }Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE8get_nameB5cxx11Ev _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE8get_nameB5cxx11Ev Line | Count | Source | 885 | 129 | String get_name() const override { return "percentile"; } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE8get_nameB5cxx11Ev |
886 | | |
887 | 100 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); }Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE15get_return_typeEv _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE15get_return_typeEv Line | Count | Source | 887 | 100 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE15get_return_typeEv |
888 | | |
889 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
890 | 122 | Arena&) const override { |
891 | 122 | const auto& sources = |
892 | 122 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
893 | 122 | const auto& quantile = |
894 | 122 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
895 | 122 | AggregateFunctionPercentile::data(place).add(sources.get_data()[row_num], |
896 | 122 | quantile.get_data(), NullMap(1, 0), 1); |
897 | 122 | } Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE3addEPcPPKNS_7IColumnElRNS_5ArenaE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 890 | 122 | Arena&) const override { | 891 | 122 | const auto& sources = | 892 | 122 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 893 | 122 | const auto& quantile = | 894 | 122 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 895 | 122 | AggregateFunctionPercentile::data(place).add(sources.get_data()[row_num], | 896 | 122 | quantile.get_data(), NullMap(1, 0), 1); | 897 | 122 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE3addEPcPPKNS_7IColumnElRNS_5ArenaE |
898 | | |
899 | | void add_batch_single_place(size_t batch_size, AggregateDataPtr place, const IColumn** columns, |
900 | 0 | Arena&) const override { |
901 | 0 | const auto& sources = |
902 | 0 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
903 | 0 | const auto& quantile = |
904 | 0 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
905 | 0 | DCHECK_EQ(sources.get_data().size(), batch_size); |
906 | 0 | AggregateFunctionPercentile::data(place).add_batch(sources.get_data(), |
907 | 0 | quantile.get_data()[0]); |
908 | 0 | } Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE |
909 | | |
910 | 29 | void check_input_columns_type(const IColumn** columns) const override { |
911 | 29 | this->template check_argument_column_type<ColVecType>(columns[0]); |
912 | 29 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); |
913 | 29 | } Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE24check_input_columns_typeEPPKNS_7IColumnE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE24check_input_columns_typeEPPKNS_7IColumnE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE24check_input_columns_typeEPPKNS_7IColumnE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 910 | 29 | void check_input_columns_type(const IColumn** columns) const override { | 911 | 29 | this->template check_argument_column_type<ColVecType>(columns[0]); | 912 | 29 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 913 | 29 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE24check_input_columns_typeEPPKNS_7IColumnE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE24check_input_columns_typeEPPKNS_7IColumnE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE24check_input_columns_typeEPPKNS_7IColumnE |
914 | | |
915 | 81 | void reset(AggregateDataPtr __restrict place) const override { |
916 | 81 | AggregateFunctionPercentile::data(place).reset(); |
917 | 81 | } Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE5resetEPc Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE5resetEPc Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE5resetEPc _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE5resetEPc Line | Count | Source | 915 | 81 | void reset(AggregateDataPtr __restrict place) const override { | 916 | 81 | AggregateFunctionPercentile::data(place).reset(); | 917 | 81 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE5resetEPc Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE5resetEPc Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE5resetEPc |
918 | | |
919 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
920 | 236 | Arena&) const override { |
921 | 236 | AggregateFunctionPercentile::data(place).merge(AggregateFunctionPercentile::data(rhs)); |
922 | 236 | } Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE5mergeEPcPKcRNS_5ArenaE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 920 | 236 | Arena&) const override { | 921 | 236 | AggregateFunctionPercentile::data(place).merge(AggregateFunctionPercentile::data(rhs)); | 922 | 236 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE5mergeEPcPKcRNS_5ArenaE |
923 | | |
924 | 236 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
925 | 236 | AggregateFunctionPercentile::data(place).write(buf); |
926 | 236 | } Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE9serializeEPKcRNS_14BufferWritableE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 924 | 236 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 925 | 236 | AggregateFunctionPercentile::data(place).write(buf); | 926 | 236 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE9serializeEPKcRNS_14BufferWritableE |
927 | | |
928 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
929 | 236 | Arena&) const override { |
930 | 236 | AggregateFunctionPercentile::data(place).read(buf); |
931 | 236 | } Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 929 | 236 | Arena&) const override { | 930 | 236 | AggregateFunctionPercentile::data(place).read(buf); | 931 | 236 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE |
932 | | |
933 | 24 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
934 | 24 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
935 | 24 | col.insert_value(AggregateFunctionPercentile::data(place).get()); |
936 | 24 | } Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE18insert_result_intoEPKcRNS_7IColumnE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE18insert_result_intoEPKcRNS_7IColumnE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE18insert_result_intoEPKcRNS_7IColumnE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 933 | 24 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 934 | 24 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); | 935 | 24 | col.insert_value(AggregateFunctionPercentile::data(place).get()); | 936 | 24 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE18insert_result_intoEPKcRNS_7IColumnE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE18insert_result_intoEPKcRNS_7IColumnE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE18insert_result_intoEPKcRNS_7IColumnE |
937 | | }; |
938 | | |
939 | | template <PrimitiveType T> |
940 | | class AggregateFunctionPercentileArray final |
941 | | : public IAggregateFunctionDataHelper<PercentileState<T>, |
942 | | AggregateFunctionPercentileArray<T>>, |
943 | | MultiExpression, |
944 | | NotNullableAggregateFunction { |
945 | | public: |
946 | | using ColVecType = typename PrimitiveTypeTraits<T>::ColumnType; |
947 | | using Base = |
948 | | IAggregateFunctionDataHelper<PercentileState<T>, AggregateFunctionPercentileArray<T>>; |
949 | 413 | AggregateFunctionPercentileArray(const DataTypes& argument_types_) : Base(argument_types_) {}Unexecuted instantiation: _ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE _ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 949 | 412 | AggregateFunctionPercentileArray(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE6EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 949 | 1 | AggregateFunctionPercentileArray(const DataTypes& argument_types_) : Base(argument_types_) {} |
Unexecuted instantiation: _ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE7EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE8EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE |
950 | | |
951 | 21 | String get_name() const override { return "percentile_array"; }Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EE8get_nameB5cxx11Ev _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EE8get_nameB5cxx11Ev Line | Count | Source | 951 | 20 | String get_name() const override { return "percentile_array"; } |
_ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE6EE8get_nameB5cxx11Ev Line | Count | Source | 951 | 1 | String get_name() const override { return "percentile_array"; } |
Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE7EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE8EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE8get_nameB5cxx11Ev |
952 | | |
953 | 0 | DataTypePtr get_return_type() const override { |
954 | 0 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); |
955 | 0 | } Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE6EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE7EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE8EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE15get_return_typeEv |
956 | | |
957 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
958 | 100 | Arena&) const override { |
959 | 100 | const auto& sources = |
960 | 100 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
961 | 100 | const auto& quantile_array = |
962 | 100 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
963 | 100 | const auto& offset_column_data = quantile_array.get_offsets(); |
964 | 100 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
965 | 100 | quantile_array.get_data()) |
966 | 100 | .get_null_map_data(); |
967 | 100 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
968 | 100 | quantile_array.get_data()) |
969 | 100 | .get_nested_column(); |
970 | 100 | const auto& nested_column_data = |
971 | 100 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); |
972 | | |
973 | 100 | AggregateFunctionPercentileArray::data(place).add( |
974 | 100 | sources.get_element(row_num), nested_column_data.get_data(), null_maps, |
975 | 100 | offset_column_data.data()[row_num] - offset_column_data[(ssize_t)row_num - 1]); |
976 | 100 | } Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EE3addEPcPPKNS_7IColumnElRNS_5ArenaE _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 958 | 100 | Arena&) const override { | 959 | 100 | const auto& sources = | 960 | 100 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 961 | 100 | const auto& quantile_array = | 962 | 100 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 963 | 100 | const auto& offset_column_data = quantile_array.get_offsets(); | 964 | 100 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 965 | 100 | quantile_array.get_data()) | 966 | 100 | .get_null_map_data(); | 967 | 100 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 968 | 100 | quantile_array.get_data()) | 969 | 100 | .get_nested_column(); | 970 | 100 | const auto& nested_column_data = | 971 | 100 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 972 | | | 973 | 100 | AggregateFunctionPercentileArray::data(place).add( | 974 | 100 | sources.get_element(row_num), nested_column_data.get_data(), null_maps, | 975 | 100 | offset_column_data.data()[row_num] - offset_column_data[(ssize_t)row_num - 1]); | 976 | 100 | } |
Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE6EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE7EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE8EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE3addEPcPPKNS_7IColumnElRNS_5ArenaE |
977 | | |
978 | 9 | void check_input_columns_type(const IColumn** columns) const override { |
979 | 9 | this->template check_argument_column_type<ColVecType>(columns[0]); |
980 | 9 | check_percentile_array_column_type(*this, *columns[1], 1); |
981 | 9 | } Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE24check_input_columns_typeEPPKNS_7IColumnE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EE24check_input_columns_typeEPPKNS_7IColumnE _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 978 | 9 | void check_input_columns_type(const IColumn** columns) const override { | 979 | 9 | this->template check_argument_column_type<ColVecType>(columns[0]); | 980 | 9 | check_percentile_array_column_type(*this, *columns[1], 1); | 981 | 9 | } |
Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE6EE24check_input_columns_typeEPPKNS_7IColumnE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE7EE24check_input_columns_typeEPPKNS_7IColumnE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE8EE24check_input_columns_typeEPPKNS_7IColumnE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE24check_input_columns_typeEPPKNS_7IColumnE |
982 | | |
983 | 26 | void reset(AggregateDataPtr __restrict place) const override { |
984 | 26 | AggregateFunctionPercentileArray::data(place).reset(); |
985 | 26 | } Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE5resetEPc Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EE5resetEPc _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EE5resetEPc Line | Count | Source | 983 | 26 | void reset(AggregateDataPtr __restrict place) const override { | 984 | 26 | AggregateFunctionPercentileArray::data(place).reset(); | 985 | 26 | } |
Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE6EE5resetEPc Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE7EE5resetEPc Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE8EE5resetEPc Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE5resetEPc |
986 | | |
987 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
988 | 121 | Arena&) const override { |
989 | 121 | AggregateFunctionPercentileArray::data(place).merge( |
990 | 121 | AggregateFunctionPercentileArray::data(rhs)); |
991 | 121 | } Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EE5mergeEPcPKcRNS_5ArenaE _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 988 | 121 | Arena&) const override { | 989 | 121 | AggregateFunctionPercentileArray::data(place).merge( | 990 | 121 | AggregateFunctionPercentileArray::data(rhs)); | 991 | 121 | } |
Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE6EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE7EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE8EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE5mergeEPcPKcRNS_5ArenaE |
992 | | |
993 | 160 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
994 | 160 | AggregateFunctionPercentileArray::data(place).write(buf); |
995 | 160 | } Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EE9serializeEPKcRNS_14BufferWritableE _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 993 | 160 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 994 | 160 | AggregateFunctionPercentileArray::data(place).write(buf); | 995 | 160 | } |
Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE6EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE7EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE8EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE9serializeEPKcRNS_14BufferWritableE |
996 | | |
997 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
998 | 121 | Arena&) const override { |
999 | 121 | AggregateFunctionPercentileArray::data(place).read(buf); |
1000 | 121 | } Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 998 | 121 | Arena&) const override { | 999 | 121 | AggregateFunctionPercentileArray::data(place).read(buf); | 1000 | 121 | } |
Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE6EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE7EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE8EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE |
1001 | | |
1002 | 0 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
1003 | 0 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); |
1004 | 0 | auto& to_nested_col = to_arr.get_data(); |
1005 | 0 | if (is_column_nullable(to_nested_col)) { |
1006 | 0 | auto col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); |
1007 | 0 | AggregateFunctionPercentileArray::data(place).insert_result_into( |
1008 | 0 | col_null->get_nested_column()); |
1009 | 0 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); |
1010 | 0 | } else { |
1011 | 0 | AggregateFunctionPercentileArray::data(place).insert_result_into(to_nested_col); |
1012 | 0 | } |
1013 | 0 | to_arr.get_offsets().push_back(to_nested_col.size()); |
1014 | 0 | } Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE18insert_result_intoEPKcRNS_7IColumnE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EE18insert_result_intoEPKcRNS_7IColumnE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EE18insert_result_intoEPKcRNS_7IColumnE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE6EE18insert_result_intoEPKcRNS_7IColumnE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE7EE18insert_result_intoEPKcRNS_7IColumnE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE8EE18insert_result_intoEPKcRNS_7IColumnE Unexecuted instantiation: _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE18insert_result_intoEPKcRNS_7IColumnE |
1015 | | }; |
1016 | | |
1017 | | template <PrimitiveType T> |
1018 | | class AggregateFunctionPercentileV2 final |
1019 | | : public IAggregateFunctionDataHelper<PercentileExactState<T>, |
1020 | | AggregateFunctionPercentileV2<T>>, |
1021 | | MultiExpression, |
1022 | | NullableAggregateFunction { |
1023 | | public: |
1024 | | using ColVecType = typename PrimitiveTypeTraits<T>::ColumnType; |
1025 | | using Base = |
1026 | | IAggregateFunctionDataHelper<PercentileExactState<T>, AggregateFunctionPercentileV2<T>>; |
1027 | 129 | AggregateFunctionPercentileV2(const DataTypes& argument_types_) : Base(argument_types_) {}_ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1027 | 9 | AggregateFunctionPercentileV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1027 | 15 | AggregateFunctionPercentileV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1027 | 38 | AggregateFunctionPercentileV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1027 | 43 | AggregateFunctionPercentileV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1027 | 3 | AggregateFunctionPercentileV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1027 | 5 | AggregateFunctionPercentileV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1027 | 16 | AggregateFunctionPercentileV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
|
1028 | | |
1029 | 45 | String get_name() const override { return "percentile_v2"; }_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE8get_nameB5cxx11Ev Line | Count | Source | 1029 | 4 | String get_name() const override { return "percentile_v2"; } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE8get_nameB5cxx11Ev Line | Count | Source | 1029 | 28 | String get_name() const override { return "percentile_v2"; } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE8get_nameB5cxx11Ev Line | Count | Source | 1029 | 1 | String get_name() const override { return "percentile_v2"; } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE8get_nameB5cxx11Ev Line | Count | Source | 1029 | 2 | String get_name() const override { return "percentile_v2"; } |
Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE8get_nameB5cxx11Ev _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE8get_nameB5cxx11Ev Line | Count | Source | 1029 | 10 | String get_name() const override { return "percentile_v2"; } |
|
1030 | | |
1031 | 965 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); }_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE15get_return_typeEv Line | Count | Source | 1031 | 80 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE15get_return_typeEv Line | Count | Source | 1031 | 412 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE15get_return_typeEv Line | Count | Source | 1031 | 166 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE15get_return_typeEv Line | Count | Source | 1031 | 185 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE15get_return_typeEv Line | Count | Source | 1031 | 11 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE15get_return_typeEv Line | Count | Source | 1031 | 17 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE15get_return_typeEv Line | Count | Source | 1031 | 94 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
|
1032 | | |
1033 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
1034 | 853 | Arena&) const override { |
1035 | 853 | const auto& sources = |
1036 | 853 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
1037 | 853 | const auto& quantile = |
1038 | 853 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
1039 | 853 | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, |
1040 | 853 | quantile.get_data()[0]); |
1041 | 853 | } _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1034 | 31 | Arena&) const override { | 1035 | 31 | const auto& sources = | 1036 | 31 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1037 | 31 | const auto& quantile = | 1038 | 31 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1039 | 31 | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, | 1040 | 31 | quantile.get_data()[0]); | 1041 | 31 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1034 | 311 | Arena&) const override { | 1035 | 311 | const auto& sources = | 1036 | 311 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1037 | 311 | const auto& quantile = | 1038 | 311 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1039 | 311 | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, | 1040 | 311 | quantile.get_data()[0]); | 1041 | 311 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1034 | 262 | Arena&) const override { | 1035 | 262 | const auto& sources = | 1036 | 262 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1037 | 262 | const auto& quantile = | 1038 | 262 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1039 | 262 | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, | 1040 | 262 | quantile.get_data()[0]); | 1041 | 262 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1034 | 192 | Arena&) const override { | 1035 | 192 | const auto& sources = | 1036 | 192 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1037 | 192 | const auto& quantile = | 1038 | 192 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1039 | 192 | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, | 1040 | 192 | quantile.get_data()[0]); | 1041 | 192 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1034 | 3 | Arena&) const override { | 1035 | 3 | const auto& sources = | 1036 | 3 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1037 | 3 | const auto& quantile = | 1038 | 3 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1039 | 3 | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, | 1040 | 3 | quantile.get_data()[0]); | 1041 | 3 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1034 | 6 | Arena&) const override { | 1035 | 6 | const auto& sources = | 1036 | 6 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1037 | 6 | const auto& quantile = | 1038 | 6 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1039 | 6 | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, | 1040 | 6 | quantile.get_data()[0]); | 1041 | 6 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1034 | 48 | Arena&) const override { | 1035 | 48 | const auto& sources = | 1036 | 48 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1037 | 48 | const auto& quantile = | 1038 | 48 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1039 | 48 | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, | 1040 | 48 | quantile.get_data()[0]); | 1041 | 48 | } |
|
1042 | | |
1043 | | void add_batch_single_place(size_t batch_size, AggregateDataPtr place, const IColumn** columns, |
1044 | 7 | Arena&) const override { |
1045 | 7 | const auto& sources = |
1046 | 7 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
1047 | 7 | const auto& quantile = |
1048 | 7 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
1049 | 7 | DCHECK_EQ(sources.get_data().size(), batch_size); |
1050 | 7 | AggregateFunctionPercentileV2::data(place).add_single_range( |
1051 | 7 | sources.get_data().data(), batch_size, quantile.get_data()[0]); |
1052 | 7 | } Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Line | Count | Source | 1044 | 2 | Arena&) const override { | 1045 | 2 | const auto& sources = | 1046 | 2 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1047 | 2 | const auto& quantile = | 1048 | 2 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1049 | | DCHECK_EQ(sources.get_data().size(), batch_size); | 1050 | 2 | AggregateFunctionPercentileV2::data(place).add_single_range( | 1051 | 2 | sources.get_data().data(), batch_size, quantile.get_data()[0]); | 1052 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Line | Count | Source | 1044 | 5 | Arena&) const override { | 1045 | 5 | const auto& sources = | 1046 | 5 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1047 | 5 | const auto& quantile = | 1048 | 5 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1049 | | DCHECK_EQ(sources.get_data().size(), batch_size); | 1050 | 5 | AggregateFunctionPercentileV2::data(place).add_single_range( | 1051 | 5 | sources.get_data().data(), batch_size, quantile.get_data()[0]); | 1052 | 5 | } |
Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE |
1053 | | |
1054 | | void add_batch_range(size_t batch_begin, size_t batch_end, AggregateDataPtr place, |
1055 | 0 | const IColumn** columns, Arena&, bool has_null) override { |
1056 | 0 | const auto& sources = |
1057 | 0 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
1058 | 0 | const auto& quantile = |
1059 | 0 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
1060 | 0 | DCHECK(!has_null); |
1061 | 0 | AggregateFunctionPercentileV2::data(place).add_single_range( |
1062 | 0 | sources.get_data().data() + batch_begin, batch_end - batch_begin + 1, |
1063 | 0 | quantile.get_data()[0]); |
1064 | 0 | } Unexecuted instantiation: _ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb |
1065 | | |
1066 | 370 | void check_input_columns_type(const IColumn** columns) const override { |
1067 | 370 | this->template check_argument_column_type<ColVecType>(columns[0]); |
1068 | 370 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); |
1069 | 370 | } _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1066 | 30 | void check_input_columns_type(const IColumn** columns) const override { | 1067 | 30 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1068 | 30 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 1069 | 30 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1066 | 186 | void check_input_columns_type(const IColumn** columns) const override { | 1067 | 186 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1068 | 186 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 1069 | 186 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1066 | 62 | void check_input_columns_type(const IColumn** columns) const override { | 1067 | 62 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1068 | 62 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 1069 | 62 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1066 | 61 | void check_input_columns_type(const IColumn** columns) const override { | 1067 | 61 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1068 | 61 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 1069 | 61 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1066 | 2 | void check_input_columns_type(const IColumn** columns) const override { | 1067 | 2 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1068 | 2 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 1069 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1066 | 3 | void check_input_columns_type(const IColumn** columns) const override { | 1067 | 3 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1068 | 3 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 1069 | 3 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1066 | 26 | void check_input_columns_type(const IColumn** columns) const override { | 1067 | 26 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1068 | 26 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 1069 | 26 | } |
|
1070 | | |
1071 | 114 | void reset(AggregateDataPtr __restrict place) const override { |
1072 | 114 | AggregateFunctionPercentileV2::data(place).reset(); |
1073 | 114 | } Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE5resetEPc _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE5resetEPc Line | Count | Source | 1071 | 102 | void reset(AggregateDataPtr __restrict place) const override { | 1072 | 102 | AggregateFunctionPercentileV2::data(place).reset(); | 1073 | 102 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE5resetEPc Line | Count | Source | 1071 | 9 | void reset(AggregateDataPtr __restrict place) const override { | 1072 | 9 | AggregateFunctionPercentileV2::data(place).reset(); | 1073 | 9 | } |
Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE5resetEPc Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE5resetEPc Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE5resetEPc _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE5resetEPc Line | Count | Source | 1071 | 3 | void reset(AggregateDataPtr __restrict place) const override { | 1072 | 3 | AggregateFunctionPercentileV2::data(place).reset(); | 1073 | 3 | } |
|
1074 | | |
1075 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
1076 | 144 | Arena&) const override { |
1077 | 144 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); |
1078 | 144 | } _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1076 | 2 | Arena&) const override { | 1077 | 2 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); | 1078 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1076 | 2 | Arena&) const override { | 1077 | 2 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); | 1078 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1076 | 40 | Arena&) const override { | 1077 | 40 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); | 1078 | 40 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1076 | 91 | Arena&) const override { | 1077 | 91 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); | 1078 | 91 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1076 | 2 | Arena&) const override { | 1077 | 2 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); | 1078 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1076 | 3 | Arena&) const override { | 1077 | 3 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); | 1078 | 3 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1076 | 4 | Arena&) const override { | 1077 | 4 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); | 1078 | 4 | } |
|
1079 | | |
1080 | 144 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
1081 | 144 | AggregateFunctionPercentileV2::data(place).write(buf); |
1082 | 144 | } _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1080 | 2 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1081 | 2 | AggregateFunctionPercentileV2::data(place).write(buf); | 1082 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1080 | 2 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1081 | 2 | AggregateFunctionPercentileV2::data(place).write(buf); | 1082 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1080 | 40 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1081 | 40 | AggregateFunctionPercentileV2::data(place).write(buf); | 1082 | 40 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1080 | 91 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1081 | 91 | AggregateFunctionPercentileV2::data(place).write(buf); | 1082 | 91 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1080 | 2 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1081 | 2 | AggregateFunctionPercentileV2::data(place).write(buf); | 1082 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1080 | 3 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1081 | 3 | AggregateFunctionPercentileV2::data(place).write(buf); | 1082 | 3 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1080 | 4 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1081 | 4 | AggregateFunctionPercentileV2::data(place).write(buf); | 1082 | 4 | } |
|
1083 | | |
1084 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
1085 | 143 | Arena&) const override { |
1086 | 143 | AggregateFunctionPercentileV2::data(place).read(buf); |
1087 | 143 | } _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1085 | 2 | Arena&) const override { | 1086 | 2 | AggregateFunctionPercentileV2::data(place).read(buf); | 1087 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1085 | 2 | Arena&) const override { | 1086 | 2 | AggregateFunctionPercentileV2::data(place).read(buf); | 1087 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1085 | 39 | Arena&) const override { | 1086 | 39 | AggregateFunctionPercentileV2::data(place).read(buf); | 1087 | 39 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1085 | 91 | Arena&) const override { | 1086 | 91 | AggregateFunctionPercentileV2::data(place).read(buf); | 1087 | 91 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1085 | 2 | Arena&) const override { | 1086 | 2 | AggregateFunctionPercentileV2::data(place).read(buf); | 1087 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1085 | 3 | Arena&) const override { | 1086 | 3 | AggregateFunctionPercentileV2::data(place).read(buf); | 1087 | 3 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1085 | 4 | Arena&) const override { | 1086 | 4 | AggregateFunctionPercentileV2::data(place).read(buf); | 1087 | 4 | } |
|
1088 | | |
1089 | 375 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
1090 | 375 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
1091 | 375 | col.insert_value(AggregateFunctionPercentileV2::data(place).get()); |
1092 | 375 | } _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1089 | 30 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1090 | 30 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); | 1091 | 30 | col.insert_value(AggregateFunctionPercentileV2::data(place).get()); | 1092 | 30 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1089 | 177 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1090 | 177 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); | 1091 | 177 | col.insert_value(AggregateFunctionPercentileV2::data(place).get()); | 1092 | 177 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1089 | 63 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1090 | 63 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); | 1091 | 63 | col.insert_value(AggregateFunctionPercentileV2::data(place).get()); | 1092 | 63 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1089 | 67 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1090 | 67 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); | 1091 | 67 | col.insert_value(AggregateFunctionPercentileV2::data(place).get()); | 1092 | 67 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE7EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1089 | 1 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1090 | 1 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); | 1091 | 1 | col.insert_value(AggregateFunctionPercentileV2::data(place).get()); | 1092 | 1 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE8EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1089 | 2 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1090 | 2 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); | 1091 | 2 | col.insert_value(AggregateFunctionPercentileV2::data(place).get()); | 1092 | 2 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE9EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1089 | 35 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1090 | 35 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); | 1091 | 35 | col.insert_value(AggregateFunctionPercentileV2::data(place).get()); | 1092 | 35 | } |
|
1093 | | }; |
1094 | | |
1095 | | template <PrimitiveType T> |
1096 | | class AggregateFunctionPercentileArrayV2 final |
1097 | | : public IAggregateFunctionDataHelper<PercentileExactState<T>, |
1098 | | AggregateFunctionPercentileArrayV2<T>>, |
1099 | | MultiExpression, |
1100 | | NotNullableAggregateFunction { |
1101 | | public: |
1102 | | using ColVecType = typename PrimitiveTypeTraits<T>::ColumnType; |
1103 | | using Base = IAggregateFunctionDataHelper<PercentileExactState<T>, |
1104 | | AggregateFunctionPercentileArrayV2<T>>; |
1105 | 99 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {}_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 4 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 5 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 54 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 13 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 4 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 2 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 17 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
|
1106 | | |
1107 | 9 | String get_name() const override { return "percentile_array_v2"; }Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE8get_nameB5cxx11Ev _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE8get_nameB5cxx11Ev Line | Count | Source | 1107 | 1 | String get_name() const override { return "percentile_array_v2"; } |
Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE8get_nameB5cxx11Ev _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE8get_nameB5cxx11Ev Line | Count | Source | 1107 | 8 | String get_name() const override { return "percentile_array_v2"; } |
|
1108 | | |
1109 | 439 | DataTypePtr get_return_type() const override { |
1110 | 439 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); |
1111 | 439 | } _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE15get_return_typeEv Line | Count | Source | 1109 | 22 | DataTypePtr get_return_type() const override { | 1110 | 22 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 22 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE15get_return_typeEv Line | Count | Source | 1109 | 27 | DataTypePtr get_return_type() const override { | 1110 | 27 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 27 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE15get_return_typeEv Line | Count | Source | 1109 | 243 | DataTypePtr get_return_type() const override { | 1110 | 243 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 243 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE15get_return_typeEv Line | Count | Source | 1109 | 37 | DataTypePtr get_return_type() const override { | 1110 | 37 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 37 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE15get_return_typeEv Line | Count | Source | 1109 | 22 | DataTypePtr get_return_type() const override { | 1110 | 22 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 22 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE15get_return_typeEv Line | Count | Source | 1109 | 10 | DataTypePtr get_return_type() const override { | 1110 | 10 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 10 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE15get_return_typeEv Line | Count | Source | 1109 | 78 | DataTypePtr get_return_type() const override { | 1110 | 78 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 78 | } |
|
1112 | | |
1113 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
1114 | 701 | Arena&) const override { |
1115 | 701 | const auto& sources = |
1116 | 701 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
1117 | 701 | const auto& quantile_array = |
1118 | 701 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
1119 | 701 | const auto& offset_column_data = quantile_array.get_offsets(); |
1120 | 701 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
1121 | 701 | quantile_array.get_data()) |
1122 | 701 | .get_null_map_data(); |
1123 | 701 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
1124 | 701 | quantile_array.get_data()) |
1125 | 701 | .get_nested_column(); |
1126 | 701 | const auto& nested_column_data = |
1127 | 701 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); |
1128 | 701 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; |
1129 | 701 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( |
1130 | 701 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, |
1131 | 701 | cast_set<int64_t>(offset_column_data[row_num] - start)); |
1132 | 701 | } _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1114 | 15 | Arena&) const override { | 1115 | 15 | const auto& sources = | 1116 | 15 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1117 | 15 | const auto& quantile_array = | 1118 | 15 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1119 | 15 | const auto& offset_column_data = quantile_array.get_offsets(); | 1120 | 15 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1121 | 15 | quantile_array.get_data()) | 1122 | 15 | .get_null_map_data(); | 1123 | 15 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1124 | 15 | quantile_array.get_data()) | 1125 | 15 | .get_nested_column(); | 1126 | 15 | const auto& nested_column_data = | 1127 | 15 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 1128 | 15 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; | 1129 | 15 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( | 1130 | 15 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, | 1131 | 15 | cast_set<int64_t>(offset_column_data[row_num] - start)); | 1132 | 15 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1114 | 30 | Arena&) const override { | 1115 | 30 | const auto& sources = | 1116 | 30 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1117 | 30 | const auto& quantile_array = | 1118 | 30 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1119 | 30 | const auto& offset_column_data = quantile_array.get_offsets(); | 1120 | 30 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1121 | 30 | quantile_array.get_data()) | 1122 | 30 | .get_null_map_data(); | 1123 | 30 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1124 | 30 | quantile_array.get_data()) | 1125 | 30 | .get_nested_column(); | 1126 | 30 | const auto& nested_column_data = | 1127 | 30 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 1128 | 30 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; | 1129 | 30 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( | 1130 | 30 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, | 1131 | 30 | cast_set<int64_t>(offset_column_data[row_num] - start)); | 1132 | 30 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1114 | 516 | Arena&) const override { | 1115 | 516 | const auto& sources = | 1116 | 516 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1117 | 516 | const auto& quantile_array = | 1118 | 516 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1119 | 516 | const auto& offset_column_data = quantile_array.get_offsets(); | 1120 | 516 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1121 | 516 | quantile_array.get_data()) | 1122 | 516 | .get_null_map_data(); | 1123 | 516 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1124 | 516 | quantile_array.get_data()) | 1125 | 516 | .get_nested_column(); | 1126 | 516 | const auto& nested_column_data = | 1127 | 516 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 1128 | 516 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; | 1129 | 516 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( | 1130 | 516 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, | 1131 | 516 | cast_set<int64_t>(offset_column_data[row_num] - start)); | 1132 | 516 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1114 | 33 | Arena&) const override { | 1115 | 33 | const auto& sources = | 1116 | 33 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1117 | 33 | const auto& quantile_array = | 1118 | 33 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1119 | 33 | const auto& offset_column_data = quantile_array.get_offsets(); | 1120 | 33 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1121 | 33 | quantile_array.get_data()) | 1122 | 33 | .get_null_map_data(); | 1123 | 33 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1124 | 33 | quantile_array.get_data()) | 1125 | 33 | .get_nested_column(); | 1126 | 33 | const auto& nested_column_data = | 1127 | 33 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 1128 | 33 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; | 1129 | 33 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( | 1130 | 33 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, | 1131 | 33 | cast_set<int64_t>(offset_column_data[row_num] - start)); | 1132 | 33 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1114 | 15 | Arena&) const override { | 1115 | 15 | const auto& sources = | 1116 | 15 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1117 | 15 | const auto& quantile_array = | 1118 | 15 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1119 | 15 | const auto& offset_column_data = quantile_array.get_offsets(); | 1120 | 15 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1121 | 15 | quantile_array.get_data()) | 1122 | 15 | .get_null_map_data(); | 1123 | 15 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1124 | 15 | quantile_array.get_data()) | 1125 | 15 | .get_nested_column(); | 1126 | 15 | const auto& nested_column_data = | 1127 | 15 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 1128 | 15 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; | 1129 | 15 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( | 1130 | 15 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, | 1131 | 15 | cast_set<int64_t>(offset_column_data[row_num] - start)); | 1132 | 15 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1114 | 3 | Arena&) const override { | 1115 | 3 | const auto& sources = | 1116 | 3 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1117 | 3 | const auto& quantile_array = | 1118 | 3 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1119 | 3 | const auto& offset_column_data = quantile_array.get_offsets(); | 1120 | 3 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1121 | 3 | quantile_array.get_data()) | 1122 | 3 | .get_null_map_data(); | 1123 | 3 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1124 | 3 | quantile_array.get_data()) | 1125 | 3 | .get_nested_column(); | 1126 | 3 | const auto& nested_column_data = | 1127 | 3 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 1128 | 3 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; | 1129 | 3 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( | 1130 | 3 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, | 1131 | 3 | cast_set<int64_t>(offset_column_data[row_num] - start)); | 1132 | 3 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 1114 | 89 | Arena&) const override { | 1115 | 89 | const auto& sources = | 1116 | 89 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1117 | 89 | const auto& quantile_array = | 1118 | 89 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1119 | 89 | const auto& offset_column_data = quantile_array.get_offsets(); | 1120 | 89 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1121 | 89 | quantile_array.get_data()) | 1122 | 89 | .get_null_map_data(); | 1123 | 89 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1124 | 89 | quantile_array.get_data()) | 1125 | 89 | .get_nested_column(); | 1126 | 89 | const auto& nested_column_data = | 1127 | 89 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 1128 | 89 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; | 1129 | 89 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( | 1130 | 89 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, | 1131 | 89 | cast_set<int64_t>(offset_column_data[row_num] - start)); | 1132 | 89 | } |
|
1133 | | |
1134 | | void add_batch_single_place(size_t batch_size, AggregateDataPtr place, const IColumn** columns, |
1135 | 1 | Arena&) const override { |
1136 | 1 | const auto& sources = |
1137 | 1 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
1138 | 1 | const auto& quantile_array = |
1139 | 1 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
1140 | 1 | const auto& offset_column_data = quantile_array.get_offsets(); |
1141 | 1 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
1142 | 1 | quantile_array.get_data()) |
1143 | 1 | .get_null_map_data(); |
1144 | 1 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
1145 | 1 | quantile_array.get_data()) |
1146 | 1 | .get_nested_column(); |
1147 | 1 | const auto& nested_column_data = |
1148 | 1 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); |
1149 | 1 | DCHECK_EQ(sources.get_data().size(), batch_size); |
1150 | 1 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( |
1151 | 1 | sources.get_data().data(), batch_size, nested_column_data.get_data(), null_maps, 0, |
1152 | 1 | cast_set<int64_t>(offset_column_data[0])); |
1153 | 1 | } Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Line | Count | Source | 1135 | 1 | Arena&) const override { | 1136 | 1 | const auto& sources = | 1137 | 1 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1138 | 1 | const auto& quantile_array = | 1139 | 1 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1140 | 1 | const auto& offset_column_data = quantile_array.get_offsets(); | 1141 | 1 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1142 | 1 | quantile_array.get_data()) | 1143 | 1 | .get_null_map_data(); | 1144 | 1 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1145 | 1 | quantile_array.get_data()) | 1146 | 1 | .get_nested_column(); | 1147 | 1 | const auto& nested_column_data = | 1148 | 1 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 1149 | | DCHECK_EQ(sources.get_data().size(), batch_size); | 1150 | 1 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( | 1151 | 1 | sources.get_data().data(), batch_size, nested_column_data.get_data(), null_maps, 0, | 1152 | 1 | cast_set<int64_t>(offset_column_data[0])); | 1153 | 1 | } |
Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE |
1154 | | |
1155 | | void add_batch_range(size_t batch_begin, size_t batch_end, AggregateDataPtr place, |
1156 | 0 | const IColumn** columns, Arena&, bool has_null) override { |
1157 | 0 | const auto& sources = |
1158 | 0 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
1159 | 0 | const auto& quantile_array = |
1160 | 0 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
1161 | 0 | const auto& offset_column_data = quantile_array.get_offsets(); |
1162 | 0 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
1163 | 0 | quantile_array.get_data()) |
1164 | 0 | .get_null_map_data(); |
1165 | 0 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
1166 | 0 | quantile_array.get_data()) |
1167 | 0 | .get_nested_column(); |
1168 | 0 | const auto& nested_column_data = |
1169 | 0 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); |
1170 | 0 | DCHECK(!has_null); |
1171 | 0 | size_t start = batch_begin == 0 ? 0 : offset_column_data[batch_begin - 1]; |
1172 | 0 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( |
1173 | 0 | sources.get_data().data() + batch_begin, batch_end - batch_begin + 1, |
1174 | 0 | nested_column_data.get_data(), null_maps, start, |
1175 | 0 | cast_set<int64_t>(offset_column_data[batch_begin] - start)); |
1176 | 0 | } Unexecuted instantiation: _ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Unexecuted instantiation: _ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb |
1177 | | |
1178 | 179 | void check_input_columns_type(const IColumn** columns) const override { |
1179 | 179 | this->template check_argument_column_type<ColVecType>(columns[0]); |
1180 | 179 | check_percentile_array_column_type(*this, *columns[1], 1); |
1181 | 179 | } _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 6 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 6 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 6 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 6 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 11 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 11 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 11 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 11 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 126 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 126 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 126 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 126 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 10 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 10 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 10 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 10 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 6 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 6 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 6 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 6 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 2 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 2 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 2 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 18 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 18 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 18 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 18 | } |
|
1182 | | |
1183 | 3 | void reset(AggregateDataPtr __restrict place) const override { |
1184 | 3 | AggregateFunctionPercentileArrayV2::data(place).reset(); |
1185 | 3 | } Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE5resetEPc Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE5resetEPc Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE5resetEPc Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE5resetEPc Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE5resetEPc Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE5resetEPc _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE5resetEPc Line | Count | Source | 1183 | 3 | void reset(AggregateDataPtr __restrict place) const override { | 1184 | 3 | AggregateFunctionPercentileArrayV2::data(place).reset(); | 1185 | 3 | } |
|
1186 | | |
1187 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
1188 | 234 | Arena&) const override { |
1189 | 234 | AggregateFunctionPercentileArrayV2::data(place).merge( |
1190 | 234 | AggregateFunctionPercentileArrayV2::data(rhs)); |
1191 | 234 | } Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE5mergeEPcPKcRNS_5ArenaE _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1188 | 196 | Arena&) const override { | 1189 | 196 | AggregateFunctionPercentileArrayV2::data(place).merge( | 1190 | 196 | AggregateFunctionPercentileArrayV2::data(rhs)); | 1191 | 196 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1188 | 1 | Arena&) const override { | 1189 | 1 | AggregateFunctionPercentileArrayV2::data(place).merge( | 1190 | 1 | AggregateFunctionPercentileArrayV2::data(rhs)); | 1191 | 1 | } |
Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE5mergeEPcPKcRNS_5ArenaE _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1188 | 37 | Arena&) const override { | 1189 | 37 | AggregateFunctionPercentileArrayV2::data(place).merge( | 1190 | 37 | AggregateFunctionPercentileArrayV2::data(rhs)); | 1191 | 37 | } |
|
1192 | | |
1193 | 234 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
1194 | 234 | AggregateFunctionPercentileArrayV2::data(place).write(buf); |
1195 | 234 | } Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE9serializeEPKcRNS_14BufferWritableE _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1193 | 196 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1194 | 196 | AggregateFunctionPercentileArrayV2::data(place).write(buf); | 1195 | 196 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1193 | 1 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1194 | 1 | AggregateFunctionPercentileArrayV2::data(place).write(buf); | 1195 | 1 | } |
Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE9serializeEPKcRNS_14BufferWritableE _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1193 | 37 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1194 | 37 | AggregateFunctionPercentileArrayV2::data(place).write(buf); | 1195 | 37 | } |
|
1196 | | |
1197 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
1198 | 234 | Arena&) const override { |
1199 | 234 | AggregateFunctionPercentileArrayV2::data(place).read(buf); |
1200 | 234 | } Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1198 | 196 | Arena&) const override { | 1199 | 196 | AggregateFunctionPercentileArrayV2::data(place).read(buf); | 1200 | 196 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1198 | 1 | Arena&) const override { | 1199 | 1 | AggregateFunctionPercentileArrayV2::data(place).read(buf); | 1200 | 1 | } |
Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1198 | 37 | Arena&) const override { | 1199 | 37 | AggregateFunctionPercentileArrayV2::data(place).read(buf); | 1200 | 37 | } |
|
1201 | | |
1202 | 276 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
1203 | 276 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); |
1204 | 276 | auto& to_nested_col = to_arr.get_data(); |
1205 | 276 | if (is_column_nullable(to_nested_col)) { |
1206 | 276 | auto* col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); |
1207 | 276 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into( |
1208 | 276 | col_null->get_nested_column()); |
1209 | 276 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); |
1210 | 276 | } else { |
1211 | 0 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into(to_nested_col); |
1212 | 0 | } |
1213 | 276 | to_arr.get_offsets().push_back(to_nested_col.size()); |
1214 | 276 | } _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1202 | 12 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1203 | 12 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 1204 | 12 | auto& to_nested_col = to_arr.get_data(); | 1205 | 12 | if (is_column_nullable(to_nested_col)) { | 1206 | 12 | auto* col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); | 1207 | 12 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into( | 1208 | 12 | col_null->get_nested_column()); | 1209 | 12 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); | 1210 | 12 | } else { | 1211 | 0 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into(to_nested_col); | 1212 | 0 | } | 1213 | 12 | to_arr.get_offsets().push_back(to_nested_col.size()); | 1214 | 12 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1202 | 13 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1203 | 13 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 1204 | 13 | auto& to_nested_col = to_arr.get_data(); | 1205 | 13 | if (is_column_nullable(to_nested_col)) { | 1206 | 13 | auto* col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); | 1207 | 13 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into( | 1208 | 13 | col_null->get_nested_column()); | 1209 | 13 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); | 1210 | 13 | } else { | 1211 | 0 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into(to_nested_col); | 1212 | 0 | } | 1213 | 13 | to_arr.get_offsets().push_back(to_nested_col.size()); | 1214 | 13 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1202 | 180 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1203 | 180 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 1204 | 180 | auto& to_nested_col = to_arr.get_data(); | 1205 | 180 | if (is_column_nullable(to_nested_col)) { | 1206 | 180 | auto* col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); | 1207 | 180 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into( | 1208 | 180 | col_null->get_nested_column()); | 1209 | 180 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); | 1210 | 180 | } else { | 1211 | 0 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into(to_nested_col); | 1212 | 0 | } | 1213 | 180 | to_arr.get_offsets().push_back(to_nested_col.size()); | 1214 | 180 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1202 | 13 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1203 | 13 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 1204 | 13 | auto& to_nested_col = to_arr.get_data(); | 1205 | 13 | if (is_column_nullable(to_nested_col)) { | 1206 | 13 | auto* col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); | 1207 | 13 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into( | 1208 | 13 | col_null->get_nested_column()); | 1209 | 13 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); | 1210 | 13 | } else { | 1211 | 0 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into(to_nested_col); | 1212 | 0 | } | 1213 | 13 | to_arr.get_offsets().push_back(to_nested_col.size()); | 1214 | 13 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1202 | 12 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1203 | 12 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 1204 | 12 | auto& to_nested_col = to_arr.get_data(); | 1205 | 12 | if (is_column_nullable(to_nested_col)) { | 1206 | 12 | auto* col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); | 1207 | 12 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into( | 1208 | 12 | col_null->get_nested_column()); | 1209 | 12 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); | 1210 | 12 | } else { | 1211 | 0 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into(to_nested_col); | 1212 | 0 | } | 1213 | 12 | to_arr.get_offsets().push_back(to_nested_col.size()); | 1214 | 12 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1202 | 2 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1203 | 2 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 1204 | 2 | auto& to_nested_col = to_arr.get_data(); | 1205 | 2 | if (is_column_nullable(to_nested_col)) { | 1206 | 2 | auto* col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); | 1207 | 2 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into( | 1208 | 2 | col_null->get_nested_column()); | 1209 | 2 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); | 1210 | 2 | } else { | 1211 | 0 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into(to_nested_col); | 1212 | 0 | } | 1213 | 2 | to_arr.get_offsets().push_back(to_nested_col.size()); | 1214 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1202 | 44 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1203 | 44 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 1204 | 44 | auto& to_nested_col = to_arr.get_data(); | 1205 | 44 | if (is_column_nullable(to_nested_col)) { | 1206 | 44 | auto* col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); | 1207 | 44 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into( | 1208 | 44 | col_null->get_nested_column()); | 1209 | 44 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); | 1210 | 44 | } else { | 1211 | 0 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into(to_nested_col); | 1212 | 0 | } | 1213 | 44 | to_arr.get_offsets().push_back(to_nested_col.size()); | 1214 | 44 | } |
|
1215 | | }; |
1216 | | |
1217 | | } // namespace doris |