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 "common/exception.h" |
32 | | #include "core/assert_cast.h" |
33 | | #include "core/column/column.h" |
34 | | #include "core/column/column_array.h" |
35 | | #include "core/column/column_nullable.h" |
36 | | #include "core/column/column_vector.h" |
37 | | #include "core/data_type/data_type_array.h" |
38 | | #include "core/data_type/data_type_nullable.h" |
39 | | #include "core/data_type/data_type_number.h" |
40 | | #include "core/pod_array.h" |
41 | | #include "core/pod_array_fwd.h" |
42 | | #include "core/types.h" |
43 | | #include "exprs/aggregate/aggregate_function.h" |
44 | | #include "util/percentile_util.h" |
45 | | #include "util/tdigest.h" |
46 | | |
47 | | namespace doris { |
48 | | |
49 | | class Arena; |
50 | | class BufferReadable; |
51 | | |
52 | | inline void check_percentile_array_column_type(const IAggregateFunction& function, |
53 | 499 | const IColumn& column, size_t index) { |
54 | 499 | const auto* array_column = check_and_get_column<ColumnArray>(column); |
55 | 499 | if (UNLIKELY(array_column == nullptr)) { |
56 | 0 | throw doris::Exception(Status::InternalError( |
57 | 0 | "Aggregate function {} argument {} type check failed: Column type {} is not " |
58 | 0 | "ColumnArray", |
59 | 0 | function.get_name(), index, column.get_name())); |
60 | 0 | } |
61 | | |
62 | 499 | const auto* nullable_column = check_and_get_column<ColumnNullable>(array_column->get_data()); |
63 | 499 | if (UNLIKELY(nullable_column == nullptr)) { |
64 | 0 | throw doris::Exception(Status::InternalError( |
65 | 0 | "Aggregate function {} argument {} type check failed: Array nested column type {} " |
66 | 0 | "is not ColumnNullable", |
67 | 0 | function.get_name(), index, array_column->get_data().get_name())); |
68 | 0 | } |
69 | | |
70 | 499 | if (UNLIKELY(check_and_get_column<ColumnFloat64>(nullable_column->get_nested_column()) == |
71 | 499 | nullptr)) { |
72 | 0 | throw doris::Exception(Status::InternalError( |
73 | 0 | "Aggregate function {} argument {} type check failed: Array nested data column " |
74 | 0 | "type {} is not ColumnFloat64", |
75 | 0 | function.get_name(), index, nullable_column->get_nested_column().get_name())); |
76 | 0 | } |
77 | 499 | } |
78 | | |
79 | | struct PercentileApproxState { |
80 | | static constexpr double INIT_QUANTILE = -1.0; |
81 | 2.13k | PercentileApproxState() = default; |
82 | 2.13k | ~PercentileApproxState() = default; |
83 | | |
84 | 1.62k | void init(double quantile, float compression = 10000) { |
85 | 1.62k | if (!init_flag) { |
86 | | //https://doris.apache.org/zh-CN/sql-reference/sql-functions/aggregate-functions/percentile_approx.html#description |
87 | | //The compression parameter setting range is [2048, 10000]. |
88 | | //If the value of compression parameter is not specified set, or is outside the range of [2048, 10000], |
89 | | //will use the default value of 10000 |
90 | 1.07k | if (!std::isfinite(compression) || compression < 2048 || compression > 10000) { |
91 | 0 | compression = 10000; |
92 | 0 | } |
93 | 1.07k | digest = TDigest::create_unique(compression); |
94 | 1.07k | check_quantile(quantile); |
95 | 1.07k | target_quantile = quantile; |
96 | 1.07k | compressions = compression; |
97 | 1.07k | init_flag = true; |
98 | 1.07k | } |
99 | 1.62k | } |
100 | | |
101 | 554 | void write(BufferWritable& buf) const { |
102 | 554 | buf.write_binary(init_flag); |
103 | 554 | if (!init_flag) { |
104 | 44 | return; |
105 | 44 | } |
106 | | |
107 | 510 | buf.write_binary(target_quantile); |
108 | 510 | buf.write_binary(compressions); |
109 | 510 | uint32_t serialize_size = digest->serialized_size(); |
110 | 510 | std::string result(serialize_size, '0'); |
111 | 510 | DCHECK(digest.get() != nullptr); |
112 | 510 | digest->serialize((uint8_t*)result.c_str()); |
113 | | |
114 | 510 | buf.write_binary(result); |
115 | 510 | } |
116 | | |
117 | 531 | void read(BufferReadable& buf) { |
118 | 531 | buf.read_binary(init_flag); |
119 | 531 | if (!init_flag) { |
120 | 44 | return; |
121 | 44 | } |
122 | | |
123 | 487 | buf.read_binary(target_quantile); |
124 | 487 | buf.read_binary(compressions); |
125 | 487 | std::string str; |
126 | 487 | buf.read_binary(str); |
127 | 487 | digest = TDigest::create_unique(compressions); |
128 | 487 | digest->unserialize((uint8_t*)str.c_str()); |
129 | 487 | } |
130 | | |
131 | 814 | double get() const { |
132 | 814 | if (init_flag) { |
133 | 768 | return digest->quantile(static_cast<float>(target_quantile)); |
134 | 768 | } else { |
135 | 46 | return std::nan(""); |
136 | 46 | } |
137 | 814 | } |
138 | | |
139 | 686 | void merge(const PercentileApproxState& rhs) { |
140 | 686 | if (!rhs.init_flag || rhs.digest->total_size() == 0) { |
141 | 178 | return; |
142 | 178 | } |
143 | 508 | if (!init_flag || digest->total_size() == 0) { |
144 | 279 | target_quantile = rhs.target_quantile; |
145 | 279 | compressions = rhs.compressions; |
146 | 279 | digest = TDigest::create_unique(compressions); |
147 | 279 | init_flag = true; |
148 | 279 | } else if (UNLIKELY(target_quantile != rhs.target_quantile || |
149 | 229 | compressions != rhs.compressions)) { |
150 | 48 | throw Exception( |
151 | 48 | ErrorCode::INVALID_ARGUMENT, |
152 | 48 | "percentile_approx aggregate states have incompatible quantile or compression"); |
153 | 48 | } |
154 | 460 | digest->merge(rhs.digest.get()); |
155 | 460 | } |
156 | | |
157 | 1.26k | void add(double source) { digest->add(static_cast<float>(source)); } |
158 | | |
159 | 352 | void add_with_weight(double source, double weight) { |
160 | | // the weight should be positive num, as have check the value valid use DCHECK_GT(c._weight, 0); |
161 | 352 | if (weight <= 0) { |
162 | 51 | return; |
163 | 51 | } |
164 | 301 | digest->add(static_cast<float>(source), static_cast<float>(weight)); |
165 | 301 | } |
166 | | |
167 | 174 | void reset() { |
168 | 174 | target_quantile = INIT_QUANTILE; |
169 | 174 | init_flag = false; |
170 | 174 | digest = TDigest::create_unique(compressions); |
171 | 174 | } |
172 | | |
173 | | bool init_flag = false; |
174 | | std::unique_ptr<TDigest> digest; |
175 | | double target_quantile = INIT_QUANTILE; |
176 | | float compressions = 10000; |
177 | | }; |
178 | | |
179 | | template <typename Derived> |
180 | | class AggregateFunctionPercentileApproxBase |
181 | | : public IAggregateFunctionDataHelper<PercentileApproxState, Derived> { |
182 | | public: |
183 | | AggregateFunctionPercentileApproxBase(const DataTypes& argument_types_) |
184 | 975 | : IAggregateFunctionDataHelper<PercentileApproxState, Derived>(argument_types_) {}_ZN5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 184 | 682 | : IAggregateFunctionDataHelper<PercentileApproxState, Derived>(argument_types_) {} |
_ZN5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 184 | 117 | : IAggregateFunctionDataHelper<PercentileApproxState, Derived>(argument_types_) {} |
_ZN5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 184 | 116 | : IAggregateFunctionDataHelper<PercentileApproxState, Derived>(argument_types_) {} |
_ZN5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 184 | 60 | : IAggregateFunctionDataHelper<PercentileApproxState, Derived>(argument_types_) {} |
|
185 | | |
186 | 164 | String get_name() const override { return "percentile_approx"; }_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE8get_nameB5cxx11Ev Line | Count | Source | 186 | 53 | String get_name() const override { return "percentile_approx"; } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE8get_nameB5cxx11Ev Line | Count | Source | 186 | 101 | String get_name() const override { return "percentile_approx"; } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE8get_nameB5cxx11Ev Line | Count | Source | 186 | 10 | String get_name() const override { return "percentile_approx"; } |
Unexecuted instantiation: _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE8get_nameB5cxx11Ev |
187 | | |
188 | 174 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); }_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE5resetEPc Line | Count | Source | 188 | 58 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE5resetEPc Line | Count | Source | 188 | 108 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE5resetEPc Line | Count | Source | 188 | 6 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE5resetEPc Line | Count | Source | 188 | 2 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
|
189 | | |
190 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
191 | 686 | Arena&) const override { |
192 | 686 | this->data(place).merge(this->data(rhs)); |
193 | 686 | } _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 191 | 413 | Arena&) const override { | 192 | 413 | this->data(place).merge(this->data(rhs)); | 193 | 413 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 191 | 131 | Arena&) const override { | 192 | 131 | this->data(place).merge(this->data(rhs)); | 193 | 131 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 191 | 94 | Arena&) const override { | 192 | 94 | this->data(place).merge(this->data(rhs)); | 193 | 94 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 191 | 48 | Arena&) const override { | 192 | 48 | this->data(place).merge(this->data(rhs)); | 193 | 48 | } |
|
194 | | |
195 | 554 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
196 | 554 | this->data(place).write(buf); |
197 | 554 | } _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 195 | 356 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 196 | 356 | this->data(place).write(buf); | 197 | 356 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 195 | 106 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 196 | 106 | this->data(place).write(buf); | 197 | 106 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 195 | 60 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 196 | 60 | this->data(place).write(buf); | 197 | 60 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 195 | 32 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 196 | 32 | this->data(place).write(buf); | 197 | 32 | } |
|
198 | | |
199 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
200 | 531 | Arena&) const override { |
201 | 531 | this->data(place).read(buf); |
202 | 531 | } _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 200 | 321 | Arena&) const override { | 201 | 321 | this->data(place).read(buf); | 202 | 321 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 200 | 110 | Arena&) const override { | 201 | 110 | this->data(place).read(buf); | 202 | 110 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 200 | 64 | Arena&) const override { | 201 | 64 | this->data(place).read(buf); | 202 | 64 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 200 | 36 | Arena&) const override { | 201 | 36 | this->data(place).read(buf); | 202 | 36 | } |
|
203 | | |
204 | 440 | void check_input_columns_type(const IColumn** columns) const override { |
205 | 1.65k | for (size_t i = 0; i < this->argument_types.size(); ++i) { |
206 | 1.21k | this->template check_argument_column_type<ColumnFloat64>(columns[i]); |
207 | 1.21k | } |
208 | 440 | } _ZNK5doris37AggregateFunctionPercentileApproxBaseINS_42AggregateFunctionPercentileApproxTwoParamsEE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 204 | 125 | void check_input_columns_type(const IColumn** columns) const override { | 205 | 377 | for (size_t i = 0; i < this->argument_types.size(); ++i) { | 206 | 252 | this->template check_argument_column_type<ColumnFloat64>(columns[i]); | 207 | 252 | } | 208 | 125 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_44AggregateFunctionPercentileApproxThreeParamsEE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 204 | 260 | void check_input_columns_type(const IColumn** columns) const override { | 205 | 1.04k | for (size_t i = 0; i < this->argument_types.size(); ++i) { | 206 | 780 | this->template check_argument_column_type<ColumnFloat64>(columns[i]); | 207 | 780 | } | 208 | 260 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_52AggregateFunctionPercentileApproxWeightedThreeParamsEE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 204 | 37 | void check_input_columns_type(const IColumn** columns) const override { | 205 | 148 | for (size_t i = 0; i < this->argument_types.size(); ++i) { | 206 | 111 | this->template check_argument_column_type<ColumnFloat64>(columns[i]); | 207 | 111 | } | 208 | 37 | } |
_ZNK5doris37AggregateFunctionPercentileApproxBaseINS_51AggregateFunctionPercentileApproxWeightedFourParamsEE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 204 | 18 | void check_input_columns_type(const IColumn** columns) const override { | 205 | 90 | for (size_t i = 0; i < this->argument_types.size(); ++i) { | 206 | 72 | this->template check_argument_column_type<ColumnFloat64>(columns[i]); | 207 | 72 | } | 208 | 18 | } |
|
209 | | }; |
210 | | |
211 | | class AggregateFunctionPercentileApproxTwoParams final |
212 | | : public AggregateFunctionPercentileApproxBase<AggregateFunctionPercentileApproxTwoParams>, |
213 | | public MultiExpression, |
214 | | public NullableAggregateFunction { |
215 | | public: |
216 | | AggregateFunctionPercentileApproxTwoParams(const DataTypes& argument_types_) |
217 | 682 | : AggregateFunctionPercentileApproxBase<AggregateFunctionPercentileApproxTwoParams>( |
218 | 682 | argument_types_) {} |
219 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
220 | 746 | Arena&) const override { |
221 | 746 | const auto& sources = |
222 | 746 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
223 | 746 | const auto& quantile = |
224 | 746 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
225 | 746 | this->data(place).init(quantile.get_element(0)); |
226 | 746 | this->data(place).add(sources.get_element(row_num)); |
227 | 746 | } |
228 | | |
229 | 641 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
230 | | |
231 | 375 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
232 | 375 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
233 | 375 | col.get_data().push_back(this->data(place).get()); |
234 | 375 | } |
235 | | }; |
236 | | |
237 | | class AggregateFunctionPercentileApproxThreeParams final |
238 | | : public AggregateFunctionPercentileApproxBase< |
239 | | AggregateFunctionPercentileApproxThreeParams>, |
240 | | public MultiExpression, |
241 | | public NullableAggregateFunction { |
242 | | public: |
243 | | AggregateFunctionPercentileApproxThreeParams(const DataTypes& argument_types_) |
244 | 117 | : AggregateFunctionPercentileApproxBase<AggregateFunctionPercentileApproxThreeParams>( |
245 | 117 | argument_types_) {} |
246 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
247 | 531 | Arena&) const override { |
248 | 531 | const auto& sources = |
249 | 531 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
250 | 531 | const auto& quantile = |
251 | 531 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
252 | 531 | const auto& compression = |
253 | 531 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); |
254 | | |
255 | 531 | this->data(place).init(quantile.get_element(0), |
256 | 531 | static_cast<float>(compression.get_element(0))); |
257 | 531 | this->data(place).add(sources.get_element(row_num)); |
258 | 531 | } |
259 | | |
260 | 693 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
261 | | |
262 | 277 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
263 | 277 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
264 | 277 | col.get_data().push_back(this->data(place).get()); |
265 | 277 | } |
266 | | }; |
267 | | |
268 | | class AggregateFunctionPercentileApproxWeightedThreeParams final |
269 | | : public AggregateFunctionPercentileApproxBase< |
270 | | AggregateFunctionPercentileApproxWeightedThreeParams>, |
271 | | MultiExpression, |
272 | | NullableAggregateFunction { |
273 | | public: |
274 | | AggregateFunctionPercentileApproxWeightedThreeParams(const DataTypes& argument_types_) |
275 | 116 | : AggregateFunctionPercentileApproxBase< |
276 | 116 | AggregateFunctionPercentileApproxWeightedThreeParams>(argument_types_) {} |
277 | | |
278 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
279 | 224 | Arena&) const override { |
280 | 224 | const auto& sources = |
281 | 224 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
282 | 224 | const auto& weight = |
283 | 224 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
284 | 224 | const auto& quantile = |
285 | 224 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); |
286 | | |
287 | 224 | this->data(place).init(quantile.get_element(0)); |
288 | 224 | this->data(place).add_with_weight(sources.get_element(row_num), |
289 | 224 | weight.get_element(row_num)); |
290 | 224 | } |
291 | | |
292 | 265 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
293 | | |
294 | 124 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
295 | 124 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
296 | 124 | col.get_data().push_back(this->data(place).get()); |
297 | 124 | } |
298 | | }; |
299 | | |
300 | | class AggregateFunctionPercentileApproxWeightedFourParams final |
301 | | : public AggregateFunctionPercentileApproxBase< |
302 | | AggregateFunctionPercentileApproxWeightedFourParams>, |
303 | | MultiExpression, |
304 | | NullableAggregateFunction { |
305 | | public: |
306 | | AggregateFunctionPercentileApproxWeightedFourParams(const DataTypes& argument_types_) |
307 | 60 | : AggregateFunctionPercentileApproxBase< |
308 | 60 | AggregateFunctionPercentileApproxWeightedFourParams>(argument_types_) {} |
309 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
310 | 128 | Arena&) const override { |
311 | 128 | const auto& sources = |
312 | 128 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
313 | 128 | const auto& weight = |
314 | 128 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
315 | 128 | const auto& quantile = |
316 | 128 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); |
317 | 128 | const auto& compression = |
318 | 128 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[3]); |
319 | | |
320 | 128 | this->data(place).init(quantile.get_element(0), |
321 | 128 | static_cast<float>(compression.get_element(0))); |
322 | 128 | this->data(place).add_with_weight(sources.get_element(row_num), |
323 | 128 | weight.get_element(row_num)); |
324 | 128 | } |
325 | | |
326 | 101 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
327 | | |
328 | 38 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
329 | 38 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
330 | 38 | col.get_data().push_back(this->data(place).get()); |
331 | 38 | } |
332 | | }; |
333 | | |
334 | | struct PercentileApproxArrayState { |
335 | 2.77k | bool has_samples() const { return !levels.empty() && digest->total_size() != 0; } |
336 | | |
337 | | void init(const PaddedPODArray<Float64>& quantiles, const NullMap& null_map, size_t start, |
338 | 797 | size_t size, float compression = 10000) { |
339 | 797 | if (init_flag) { |
340 | 0 | return; |
341 | 0 | } |
342 | | |
343 | 797 | if (!std::isfinite(compression) || compression < 2048 || compression > 10000) { |
344 | 7 | compression = 10000; |
345 | 7 | } |
346 | 797 | compressions = compression; |
347 | 797 | levels.quantiles.resize(size); |
348 | 797 | levels.permutation.resize(size); |
349 | 2.16k | for (size_t i = 0; i < size; ++i) { |
350 | 1.37k | if (null_map[start + i]) { |
351 | 1 | throw Exception(ErrorCode::INVALID_ARGUMENT, |
352 | 1 | "percentile_approx_array quantile should not be null"); |
353 | 1 | } |
354 | 1.37k | check_quantile(quantiles[start + i]); |
355 | 1.37k | levels.quantiles[i] = quantiles[start + i]; |
356 | 1.37k | levels.permutation[i] = i; |
357 | 1.37k | } |
358 | 796 | if (!levels.empty()) { |
359 | 718 | digest = TDigest::create_unique(compressions); |
360 | 718 | } |
361 | 796 | init_flag = true; |
362 | 796 | } |
363 | | |
364 | 905 | void add_range(const Float64* values, size_t size) { |
365 | 905 | if (levels.empty()) { |
366 | 81 | return; |
367 | 81 | } |
368 | 1.68k | for (size_t i = 0; i < size; ++i) { |
369 | 862 | digest->add(static_cast<float>(values[i])); |
370 | 862 | } |
371 | 824 | } |
372 | | |
373 | 913 | void write(BufferWritable& buf) const { |
374 | | // Sample-free states share the fresh-state encoding, independent of their parameters. |
375 | 913 | const bool has_data = has_samples(); |
376 | 913 | buf.write_binary(has_data); |
377 | 913 | if (!has_data) { |
378 | 619 | return; |
379 | 619 | } |
380 | | |
381 | 294 | levels.write(buf); |
382 | 294 | buf.write_binary(compressions); |
383 | 294 | uint32_t serialize_size = digest->serialized_size(); |
384 | 294 | std::string result(serialize_size, '0'); |
385 | 294 | digest->serialize(reinterpret_cast<uint8_t*>(result.data())); |
386 | 294 | buf.write_binary(result); |
387 | 294 | } |
388 | | |
389 | 566 | void read(BufferReadable& buf) { |
390 | 566 | reset(); |
391 | 566 | buf.read_binary(init_flag); |
392 | 566 | if (!init_flag) { |
393 | 259 | return; |
394 | 259 | } |
395 | | |
396 | 307 | levels.read(buf); |
397 | 307 | buf.read_binary(compressions); |
398 | 307 | if (levels.empty()) { |
399 | 0 | return; |
400 | 0 | } |
401 | 307 | std::string str; |
402 | 307 | buf.read_binary(str); |
403 | 307 | digest = TDigest::create_unique(compressions); |
404 | 307 | digest->unserialize(reinterpret_cast<const uint8_t*>(str.data())); |
405 | 307 | } |
406 | | |
407 | 740 | void merge(const PercentileApproxArrayState& rhs) { |
408 | 740 | if (!rhs.has_samples()) { |
409 | 316 | return; |
410 | 316 | } |
411 | | |
412 | 424 | if (!has_samples()) { |
413 | 335 | levels = rhs.levels; |
414 | 335 | compressions = rhs.compressions; |
415 | 335 | digest = TDigest::create_unique(compressions); |
416 | 335 | init_flag = true; |
417 | 335 | } else if (UNLIKELY(compressions != rhs.compressions || |
418 | 89 | levels.quantiles != rhs.levels.quantiles)) { |
419 | 50 | throw Exception(ErrorCode::INVALID_ARGUMENT, |
420 | 50 | "percentile_approx_array aggregate states have incompatible quantiles " |
421 | 50 | "or compression"); |
422 | 50 | } |
423 | 374 | digest->merge(rhs.digest.get()); |
424 | 374 | } |
425 | | |
426 | 612 | void reset() { |
427 | 612 | init_flag = false; |
428 | 612 | levels.clear(); |
429 | 612 | digest.reset(); |
430 | 612 | compressions = 10000; |
431 | 612 | } |
432 | | |
433 | 697 | void insert_result_into(IColumn& to) const { |
434 | 697 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); |
435 | 697 | if (!has_samples()) { |
436 | 275 | return; |
437 | 275 | } |
438 | | |
439 | 422 | const size_t old_size = column_data.size(); |
440 | 422 | const size_t size = levels.quantiles.size(); |
441 | 422 | column_data.resize(old_size + size); |
442 | 422 | digest->quantiles(levels.quantiles.data(), levels.get_permutation().data(), size, |
443 | 422 | column_data.data() + old_size); |
444 | 422 | } |
445 | | |
446 | | bool init_flag = false; |
447 | | PercentileLevels levels; |
448 | | std::unique_ptr<TDigest> digest; |
449 | | float compressions = 10000; |
450 | | }; |
451 | | |
452 | | template <bool has_compression> |
453 | | class AggregateFunctionPercentileApproxArray final |
454 | | : public IAggregateFunctionDataHelper< |
455 | | PercentileApproxArrayState, |
456 | | AggregateFunctionPercentileApproxArray<has_compression>>, |
457 | | MultiExpression, |
458 | | NotNullableAggregateFunction { |
459 | | public: |
460 | | using Base = |
461 | | IAggregateFunctionDataHelper<PercentileApproxArrayState, |
462 | | AggregateFunctionPercentileApproxArray<has_compression>>; |
463 | | |
464 | | AggregateFunctionPercentileApproxArray(const DataTypes& argument_types_) |
465 | 1.22k | : Base(argument_types_) {}_ZN5doris38AggregateFunctionPercentileApproxArrayILb0EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS6_EE Line | Count | Source | 465 | 148 | : Base(argument_types_) {} |
_ZN5doris38AggregateFunctionPercentileApproxArrayILb1EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS6_EE Line | Count | Source | 465 | 1.07k | : Base(argument_types_) {} |
|
466 | | |
467 | 0 | String get_name() const override { return "percentile_approx_array"; }Unexecuted instantiation: _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE8get_nameB5cxx11Ev |
468 | | |
469 | 1.19k | DataTypePtr get_return_type() const override { |
470 | 1.19k | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); |
471 | 1.19k | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE15get_return_typeEv Line | Count | Source | 469 | 503 | DataTypePtr get_return_type() const override { | 470 | 503 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 471 | 503 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE15get_return_typeEv Line | Count | Source | 469 | 688 | DataTypePtr get_return_type() const override { | 470 | 688 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 471 | 688 | } |
|
472 | | |
473 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
474 | 824 | Arena&) const override { |
475 | 824 | const auto& sources = |
476 | 824 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
477 | 824 | _add_values(this->data(place), &sources.get_data()[row_num], 1, columns, |
478 | 824 | cast_set<size_t>(row_num)); |
479 | 824 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 474 | 451 | Arena&) const override { | 475 | 451 | const auto& sources = | 476 | 451 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 477 | 451 | _add_values(this->data(place), &sources.get_data()[row_num], 1, columns, | 478 | 451 | cast_set<size_t>(row_num)); | 479 | 451 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 474 | 373 | Arena&) const override { | 475 | 373 | const auto& sources = | 476 | 373 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 477 | 373 | _add_values(this->data(place), &sources.get_data()[row_num], 1, columns, | 478 | 373 | cast_set<size_t>(row_num)); | 479 | 373 | } |
|
480 | | |
481 | | void add_batch_single_place(size_t batch_size, AggregateDataPtr place, const IColumn** columns, |
482 | 84 | Arena&) const override { |
483 | 84 | const auto& sources = |
484 | 84 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
485 | 84 | DCHECK_EQ(sources.get_data().size(), batch_size); |
486 | 84 | _add_values(this->data(place), sources.get_data().data(), batch_size, columns, 0); |
487 | 84 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Line | Count | Source | 482 | 7 | Arena&) const override { | 483 | 7 | const auto& sources = | 484 | 7 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 485 | | DCHECK_EQ(sources.get_data().size(), batch_size); | 486 | 7 | _add_values(this->data(place), sources.get_data().data(), batch_size, columns, 0); | 487 | 7 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE22add_batch_single_placeEmPcPPKNS_7IColumnERNS_5ArenaE Line | Count | Source | 482 | 77 | Arena&) const override { | 483 | 77 | const auto& sources = | 484 | 77 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 485 | | DCHECK_EQ(sources.get_data().size(), batch_size); | 486 | 77 | _add_values(this->data(place), sources.get_data().data(), batch_size, columns, 0); | 487 | 77 | } |
|
488 | | |
489 | | void add_batch_range(size_t batch_begin, size_t batch_end, AggregateDataPtr place, |
490 | 1 | const IColumn** columns, Arena&, bool has_null) override { |
491 | 1 | DCHECK(!has_null); |
492 | 1 | const auto& sources = |
493 | 1 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
494 | 1 | _add_values(this->data(place), sources.get_data().data() + batch_begin, |
495 | 1 | batch_end - batch_begin + 1, columns, batch_begin); |
496 | 1 | } _ZN5doris38AggregateFunctionPercentileApproxArrayILb0EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb Line | Count | Source | 490 | 1 | const IColumn** columns, Arena&, bool has_null) override { | 491 | | DCHECK(!has_null); | 492 | 1 | const auto& sources = | 493 | 1 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 494 | 1 | _add_values(this->data(place), sources.get_data().data() + batch_begin, | 495 | 1 | batch_end - batch_begin + 1, columns, batch_begin); | 496 | 1 | } |
Unexecuted instantiation: _ZN5doris38AggregateFunctionPercentileApproxArrayILb1EE15add_batch_rangeEmmPcPPKNS_7IColumnERNS_5ArenaEb |
497 | | |
498 | 209 | void check_input_columns_type(const IColumn** columns) const override { |
499 | 209 | this->template check_argument_column_type<ColumnFloat64>(columns[0]); |
500 | 209 | check_percentile_array_column_type(*this, *columns[1], 1); |
501 | 209 | if constexpr (has_compression) { |
502 | 170 | this->template check_argument_column_type<ColumnFloat64>(columns[2]); |
503 | 170 | } |
504 | 209 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 498 | 39 | void check_input_columns_type(const IColumn** columns) const override { | 499 | 39 | this->template check_argument_column_type<ColumnFloat64>(columns[0]); | 500 | 39 | check_percentile_array_column_type(*this, *columns[1], 1); | 501 | | if constexpr (has_compression) { | 502 | | this->template check_argument_column_type<ColumnFloat64>(columns[2]); | 503 | | } | 504 | 39 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 498 | 170 | void check_input_columns_type(const IColumn** columns) const override { | 499 | 170 | this->template check_argument_column_type<ColumnFloat64>(columns[0]); | 500 | 170 | check_percentile_array_column_type(*this, *columns[1], 1); | 501 | 170 | if constexpr (has_compression) { | 502 | 170 | this->template check_argument_column_type<ColumnFloat64>(columns[2]); | 503 | 170 | } | 504 | 170 | } |
|
505 | | |
506 | 46 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); }_ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE5resetEPc Line | Count | Source | 506 | 25 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE5resetEPc Line | Count | Source | 506 | 21 | void reset(AggregateDataPtr __restrict place) const override { this->data(place).reset(); } |
|
507 | | |
508 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
509 | 740 | Arena&) const override { |
510 | 740 | this->data(place).merge(this->data(rhs)); |
511 | 740 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 509 | 278 | Arena&) const override { | 510 | 278 | this->data(place).merge(this->data(rhs)); | 511 | 278 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 509 | 462 | Arena&) const override { | 510 | 462 | this->data(place).merge(this->data(rhs)); | 511 | 462 | } |
|
512 | | |
513 | 914 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
514 | 914 | this->data(place).write(buf); |
515 | 914 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 513 | 345 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 514 | 345 | this->data(place).write(buf); | 515 | 345 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 513 | 569 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 514 | 569 | this->data(place).write(buf); | 515 | 569 | } |
|
516 | | |
517 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
518 | 566 | Arena&) const override { |
519 | 566 | this->data(place).read(buf); |
520 | 566 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 518 | 173 | Arena&) const override { | 519 | 173 | this->data(place).read(buf); | 520 | 173 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 518 | 393 | Arena&) const override { | 519 | 393 | this->data(place).read(buf); | 520 | 393 | } |
|
521 | | |
522 | 697 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
523 | 697 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); |
524 | 697 | auto& nullable_data = |
525 | 697 | assert_cast<ColumnNullable&, TypeCheckOnRelease::DISABLE>(to_arr.get_data()); |
526 | 697 | auto& nested_data = nullable_data.get_nested_column(); |
527 | 697 | this->data(place).insert_result_into(nested_data); |
528 | 697 | nullable_data.get_null_map_data().resize_fill(nested_data.size(), 0); |
529 | 697 | to_arr.get_offsets().push_back(nested_data.size()); |
530 | 697 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 522 | 381 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 523 | 381 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 524 | 381 | auto& nullable_data = | 525 | 381 | assert_cast<ColumnNullable&, TypeCheckOnRelease::DISABLE>(to_arr.get_data()); | 526 | 381 | auto& nested_data = nullable_data.get_nested_column(); | 527 | 381 | this->data(place).insert_result_into(nested_data); | 528 | 381 | nullable_data.get_null_map_data().resize_fill(nested_data.size(), 0); | 529 | 381 | to_arr.get_offsets().push_back(nested_data.size()); | 530 | 381 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 522 | 316 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 523 | 316 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 524 | 316 | auto& nullable_data = | 525 | 316 | assert_cast<ColumnNullable&, TypeCheckOnRelease::DISABLE>(to_arr.get_data()); | 526 | 316 | auto& nested_data = nullable_data.get_nested_column(); | 527 | 316 | this->data(place).insert_result_into(nested_data); | 528 | 316 | nullable_data.get_null_map_data().resize_fill(nested_data.size(), 0); | 529 | 316 | to_arr.get_offsets().push_back(nested_data.size()); | 530 | 316 | } |
|
531 | | |
532 | | private: |
533 | | void _add_values(PercentileApproxArrayState& state, const Float64* values, size_t value_size, |
534 | 909 | const IColumn** columns, size_t quantile_row) const { |
535 | 909 | if (!state.init_flag) { |
536 | 797 | const auto& quantile_array = |
537 | 797 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
538 | 797 | const auto& offsets = quantile_array.get_offsets(); |
539 | 797 | const auto& nullable_quantiles = |
540 | 797 | assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
541 | 797 | quantile_array.get_data()); |
542 | 797 | const auto& quantiles = assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>( |
543 | 797 | nullable_quantiles.get_nested_column()) |
544 | 797 | .get_data(); |
545 | 797 | const auto& null_map = nullable_quantiles.get_null_map_data(); |
546 | 797 | const size_t start = quantile_row == 0 ? 0 : offsets[quantile_row - 1]; |
547 | 797 | const size_t quantile_size = offsets[quantile_row] - start; |
548 | | |
549 | 797 | float compression = 10000; |
550 | 797 | if constexpr (has_compression) { |
551 | 406 | const auto& compression_column = |
552 | 406 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); |
553 | 406 | compression = static_cast<float>(compression_column.get_element(0)); |
554 | 406 | } |
555 | 797 | state.init(quantiles, null_map, start, quantile_size, compression); |
556 | 797 | } |
557 | 909 | state.add_range(values, value_size); |
558 | 909 | } _ZNK5doris38AggregateFunctionPercentileApproxArrayILb0EE11_add_valuesERNS_26PercentileApproxArrayStateEPKdmPPKNS_7IColumnEm Line | Count | Source | 534 | 459 | const IColumn** columns, size_t quantile_row) const { | 535 | 459 | if (!state.init_flag) { | 536 | 391 | const auto& quantile_array = | 537 | 391 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 538 | 391 | const auto& offsets = quantile_array.get_offsets(); | 539 | 391 | const auto& nullable_quantiles = | 540 | 391 | assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 541 | 391 | quantile_array.get_data()); | 542 | 391 | const auto& quantiles = assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>( | 543 | 391 | nullable_quantiles.get_nested_column()) | 544 | 391 | .get_data(); | 545 | 391 | const auto& null_map = nullable_quantiles.get_null_map_data(); | 546 | 391 | const size_t start = quantile_row == 0 ? 0 : offsets[quantile_row - 1]; | 547 | 391 | const size_t quantile_size = offsets[quantile_row] - start; | 548 | | | 549 | 391 | float compression = 10000; | 550 | | if constexpr (has_compression) { | 551 | | const auto& compression_column = | 552 | | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); | 553 | | compression = static_cast<float>(compression_column.get_element(0)); | 554 | | } | 555 | 391 | state.init(quantiles, null_map, start, quantile_size, compression); | 556 | 391 | } | 557 | 459 | state.add_range(values, value_size); | 558 | 459 | } |
_ZNK5doris38AggregateFunctionPercentileApproxArrayILb1EE11_add_valuesERNS_26PercentileApproxArrayStateEPKdmPPKNS_7IColumnEm Line | Count | Source | 534 | 450 | const IColumn** columns, size_t quantile_row) const { | 535 | 450 | if (!state.init_flag) { | 536 | 406 | const auto& quantile_array = | 537 | 406 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 538 | 406 | const auto& offsets = quantile_array.get_offsets(); | 539 | 406 | const auto& nullable_quantiles = | 540 | 406 | assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 541 | 406 | quantile_array.get_data()); | 542 | 406 | const auto& quantiles = assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>( | 543 | 406 | nullable_quantiles.get_nested_column()) | 544 | 406 | .get_data(); | 545 | 406 | const auto& null_map = nullable_quantiles.get_null_map_data(); | 546 | 406 | const size_t start = quantile_row == 0 ? 0 : offsets[quantile_row - 1]; | 547 | 406 | const size_t quantile_size = offsets[quantile_row] - start; | 548 | | | 549 | 406 | float compression = 10000; | 550 | 406 | if constexpr (has_compression) { | 551 | 406 | const auto& compression_column = | 552 | 406 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[2]); | 553 | 406 | compression = static_cast<float>(compression_column.get_element(0)); | 554 | 406 | } | 555 | 406 | state.init(quantiles, null_map, start, quantile_size, compression); | 556 | 406 | } | 557 | 450 | state.add_range(values, value_size); | 558 | 450 | } |
|
559 | | }; |
560 | | |
561 | | template <PrimitiveType T> |
562 | | struct PercentileState { |
563 | | mutable std::vector<Counts<typename PrimitiveTypeTraits<T>::CppType>> vec_counts; |
564 | | std::vector<double> vec_quantile {-1}; |
565 | | bool inited_flag = false; |
566 | | |
567 | 478 | void write(BufferWritable& buf) const { |
568 | 478 | buf.write_binary(inited_flag); |
569 | 478 | if (!inited_flag) { |
570 | 22 | return; |
571 | 22 | } |
572 | 456 | int size_num = cast_set<int>(vec_quantile.size()); |
573 | 456 | buf.write_binary(size_num); |
574 | 762 | for (const auto& quantile : vec_quantile) { |
575 | 762 | buf.write_binary(quantile); |
576 | 762 | } |
577 | 762 | for (auto& counts : vec_counts) { |
578 | 762 | counts.serialize(buf); |
579 | 762 | } |
580 | 456 | } _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE3EE5writeERNS_14BufferWritableE Line | Count | Source | 567 | 38 | void write(BufferWritable& buf) const { | 568 | 38 | buf.write_binary(inited_flag); | 569 | 38 | if (!inited_flag) { | 570 | 0 | return; | 571 | 0 | } | 572 | 38 | int size_num = cast_set<int>(vec_quantile.size()); | 573 | 38 | buf.write_binary(size_num); | 574 | 38 | for (const auto& quantile : vec_quantile) { | 575 | 38 | buf.write_binary(quantile); | 576 | 38 | } | 577 | 38 | for (auto& counts : vec_counts) { | 578 | 38 | counts.serialize(buf); | 579 | 38 | } | 580 | 38 | } |
Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE4EE5writeERNS_14BufferWritableE _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE5EE5writeERNS_14BufferWritableE Line | Count | Source | 567 | 160 | void write(BufferWritable& buf) const { | 568 | 160 | buf.write_binary(inited_flag); | 569 | 160 | if (!inited_flag) { | 570 | 8 | return; | 571 | 8 | } | 572 | 152 | int size_num = cast_set<int>(vec_quantile.size()); | 573 | 152 | buf.write_binary(size_num); | 574 | 456 | for (const auto& quantile : vec_quantile) { | 575 | 456 | buf.write_binary(quantile); | 576 | 456 | } | 577 | 456 | for (auto& counts : vec_counts) { | 578 | 456 | counts.serialize(buf); | 579 | 456 | } | 580 | 152 | } |
_ZNK5doris15PercentileStateILNS_13PrimitiveTypeE6EE5writeERNS_14BufferWritableE Line | Count | Source | 567 | 232 | void write(BufferWritable& buf) const { | 568 | 232 | buf.write_binary(inited_flag); | 569 | 232 | if (!inited_flag) { | 570 | 0 | return; | 571 | 0 | } | 572 | 232 | int size_num = cast_set<int>(vec_quantile.size()); | 573 | 232 | buf.write_binary(size_num); | 574 | 232 | for (const auto& quantile : vec_quantile) { | 575 | 231 | buf.write_binary(quantile); | 576 | 231 | } | 577 | 232 | for (auto& counts : vec_counts) { | 578 | 231 | counts.serialize(buf); | 579 | 231 | } | 580 | 232 | } |
Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE7EE5writeERNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE8EE5writeERNS_14BufferWritableE _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE9EE5writeERNS_14BufferWritableE Line | Count | Source | 567 | 48 | void write(BufferWritable& buf) const { | 568 | 48 | buf.write_binary(inited_flag); | 569 | 48 | if (!inited_flag) { | 570 | 14 | return; | 571 | 14 | } | 572 | 34 | int size_num = cast_set<int>(vec_quantile.size()); | 573 | 34 | buf.write_binary(size_num); | 574 | 37 | for (const auto& quantile : vec_quantile) { | 575 | 37 | buf.write_binary(quantile); | 576 | 37 | } | 577 | 37 | for (auto& counts : vec_counts) { | 578 | 37 | counts.serialize(buf); | 579 | 37 | } | 580 | 34 | } |
|
581 | | |
582 | 442 | void read(BufferReadable& buf) { |
583 | 442 | buf.read_binary(inited_flag); |
584 | 442 | if (!inited_flag) { |
585 | 22 | return; |
586 | 22 | } |
587 | 420 | int size_num = 0; |
588 | 420 | buf.read_binary(size_num); |
589 | 420 | double data = 0.0; |
590 | 420 | vec_quantile.clear(); |
591 | 1.07k | for (int i = 0; i < size_num; ++i) { |
592 | 651 | buf.read_binary(data); |
593 | 651 | vec_quantile.emplace_back(data); |
594 | 651 | } |
595 | 420 | vec_counts.clear(); |
596 | 420 | vec_counts.resize(size_num); |
597 | 1.07k | for (int i = 0; i < size_num; ++i) { |
598 | 651 | vec_counts[i].unserialize(buf); |
599 | 651 | } |
600 | 420 | } _ZN5doris15PercentileStateILNS_13PrimitiveTypeE3EE4readERNS_14BufferReadableE Line | Count | Source | 582 | 38 | void read(BufferReadable& buf) { | 583 | 38 | buf.read_binary(inited_flag); | 584 | 38 | if (!inited_flag) { | 585 | 0 | return; | 586 | 0 | } | 587 | 38 | int size_num = 0; | 588 | 38 | buf.read_binary(size_num); | 589 | 38 | double data = 0.0; | 590 | 38 | vec_quantile.clear(); | 591 | 76 | for (int i = 0; i < size_num; ++i) { | 592 | 38 | buf.read_binary(data); | 593 | 38 | vec_quantile.emplace_back(data); | 594 | 38 | } | 595 | 38 | vec_counts.clear(); | 596 | 38 | vec_counts.resize(size_num); | 597 | 76 | for (int i = 0; i < size_num; ++i) { | 598 | 38 | vec_counts[i].unserialize(buf); | 599 | 38 | } | 600 | 38 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE4EE4readERNS_14BufferReadableE _ZN5doris15PercentileStateILNS_13PrimitiveTypeE5EE4readERNS_14BufferReadableE Line | Count | Source | 582 | 121 | void read(BufferReadable& buf) { | 583 | 121 | buf.read_binary(inited_flag); | 584 | 121 | if (!inited_flag) { | 585 | 8 | return; | 586 | 8 | } | 587 | 113 | int size_num = 0; | 588 | 113 | buf.read_binary(size_num); | 589 | 113 | double data = 0.0; | 590 | 113 | vec_quantile.clear(); | 591 | 452 | for (int i = 0; i < size_num; ++i) { | 592 | 339 | buf.read_binary(data); | 593 | 339 | vec_quantile.emplace_back(data); | 594 | 339 | } | 595 | 113 | vec_counts.clear(); | 596 | 113 | vec_counts.resize(size_num); | 597 | 452 | for (int i = 0; i < size_num; ++i) { | 598 | 339 | vec_counts[i].unserialize(buf); | 599 | 339 | } | 600 | 113 | } |
_ZN5doris15PercentileStateILNS_13PrimitiveTypeE6EE4readERNS_14BufferReadableE Line | Count | Source | 582 | 223 | void read(BufferReadable& buf) { | 583 | 223 | buf.read_binary(inited_flag); | 584 | 223 | if (!inited_flag) { | 585 | 0 | return; | 586 | 0 | } | 587 | 223 | int size_num = 0; | 588 | 223 | buf.read_binary(size_num); | 589 | 223 | double data = 0.0; | 590 | 223 | vec_quantile.clear(); | 591 | 446 | for (int i = 0; i < size_num; ++i) { | 592 | 223 | buf.read_binary(data); | 593 | 223 | vec_quantile.emplace_back(data); | 594 | 223 | } | 595 | 223 | vec_counts.clear(); | 596 | 223 | vec_counts.resize(size_num); | 597 | 446 | for (int i = 0; i < size_num; ++i) { | 598 | 223 | vec_counts[i].unserialize(buf); | 599 | 223 | } | 600 | 223 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE7EE4readERNS_14BufferReadableE Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE8EE4readERNS_14BufferReadableE _ZN5doris15PercentileStateILNS_13PrimitiveTypeE9EE4readERNS_14BufferReadableE Line | Count | Source | 582 | 60 | void read(BufferReadable& buf) { | 583 | 60 | buf.read_binary(inited_flag); | 584 | 60 | if (!inited_flag) { | 585 | 14 | return; | 586 | 14 | } | 587 | 46 | int size_num = 0; | 588 | 46 | buf.read_binary(size_num); | 589 | 46 | double data = 0.0; | 590 | 46 | vec_quantile.clear(); | 591 | 97 | for (int i = 0; i < size_num; ++i) { | 592 | 51 | buf.read_binary(data); | 593 | 51 | vec_quantile.emplace_back(data); | 594 | 51 | } | 595 | 46 | vec_counts.clear(); | 596 | 46 | vec_counts.resize(size_num); | 597 | 97 | for (int i = 0; i < size_num; ++i) { | 598 | 51 | vec_counts[i].unserialize(buf); | 599 | 51 | } | 600 | 46 | } |
|
601 | | |
602 | | void add(typename PrimitiveTypeTraits<T>::CppType source, |
603 | 407 | const PaddedPODArray<Float64>& quantiles, const NullMap& null_maps, int64_t arg_size) { |
604 | 407 | if (!inited_flag) { |
605 | 397 | vec_counts.resize(arg_size); |
606 | 397 | vec_quantile.resize(arg_size, -1); |
607 | 397 | inited_flag = true; |
608 | 1.00k | for (int i = 0; i < arg_size; ++i) { |
609 | | // throw Exception func call percentile_array(id, [1,0,null]) |
610 | 603 | if (null_maps[i]) { |
611 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, |
612 | 0 | "quantiles in func percentile_array should not have null"); |
613 | 0 | } |
614 | 603 | check_quantile(quantiles[i]); |
615 | 603 | vec_quantile[i] = quantiles[i]; |
616 | 603 | } |
617 | 397 | } |
618 | 1.02k | for (int i = 0; i < arg_size; ++i) { |
619 | 614 | vec_counts[i].increment(source); |
620 | 614 | } |
621 | 407 | } _ZN5doris15PercentileStateILNS_13PrimitiveTypeE3EE3addEaRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl Line | Count | Source | 603 | 32 | const PaddedPODArray<Float64>& quantiles, const NullMap& null_maps, int64_t arg_size) { | 604 | 32 | if (!inited_flag) { | 605 | 32 | vec_counts.resize(arg_size); | 606 | 32 | vec_quantile.resize(arg_size, -1); | 607 | 32 | inited_flag = true; | 608 | 64 | for (int i = 0; i < arg_size; ++i) { | 609 | | // throw Exception func call percentile_array(id, [1,0,null]) | 610 | 32 | if (null_maps[i]) { | 611 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 612 | 0 | "quantiles in func percentile_array should not have null"); | 613 | 0 | } | 614 | 32 | check_quantile(quantiles[i]); | 615 | 32 | vec_quantile[i] = quantiles[i]; | 616 | 32 | } | 617 | 32 | } | 618 | 64 | for (int i = 0; i < arg_size; ++i) { | 619 | 32 | vec_counts[i].increment(source); | 620 | 32 | } | 621 | 32 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE4EE3addEsRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl _ZN5doris15PercentileStateILNS_13PrimitiveTypeE5EE3addEiRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl Line | Count | Source | 603 | 100 | const PaddedPODArray<Float64>& quantiles, const NullMap& null_maps, int64_t arg_size) { | 604 | 100 | if (!inited_flag) { | 605 | 100 | vec_counts.resize(arg_size); | 606 | 100 | vec_quantile.resize(arg_size, -1); | 607 | 100 | inited_flag = true; | 608 | 400 | for (int i = 0; i < arg_size; ++i) { | 609 | | // throw Exception func call percentile_array(id, [1,0,null]) | 610 | 300 | if (null_maps[i]) { | 611 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 612 | 0 | "quantiles in func percentile_array should not have null"); | 613 | 0 | } | 614 | 300 | check_quantile(quantiles[i]); | 615 | 300 | vec_quantile[i] = quantiles[i]; | 616 | 300 | } | 617 | 100 | } | 618 | 400 | for (int i = 0; i < arg_size; ++i) { | 619 | 300 | vec_counts[i].increment(source); | 620 | 300 | } | 621 | 100 | } |
_ZN5doris15PercentileStateILNS_13PrimitiveTypeE6EE3addElRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl Line | Count | Source | 603 | 122 | const PaddedPODArray<Float64>& quantiles, const NullMap& null_maps, int64_t arg_size) { | 604 | 122 | if (!inited_flag) { | 605 | 122 | vec_counts.resize(arg_size); | 606 | 122 | vec_quantile.resize(arg_size, -1); | 607 | 122 | inited_flag = true; | 608 | 244 | for (int i = 0; i < arg_size; ++i) { | 609 | | // throw Exception func call percentile_array(id, [1,0,null]) | 610 | 122 | if (null_maps[i]) { | 611 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 612 | 0 | "quantiles in func percentile_array should not have null"); | 613 | 0 | } | 614 | 122 | check_quantile(quantiles[i]); | 615 | 122 | vec_quantile[i] = quantiles[i]; | 616 | 122 | } | 617 | 122 | } | 618 | 244 | for (int i = 0; i < arg_size; ++i) { | 619 | 122 | vec_counts[i].increment(source); | 620 | 122 | } | 621 | 122 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE7EE3addEnRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE8EE3addEfRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl _ZN5doris15PercentileStateILNS_13PrimitiveTypeE9EE3addEdRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEl Line | Count | Source | 603 | 153 | const PaddedPODArray<Float64>& quantiles, const NullMap& null_maps, int64_t arg_size) { | 604 | 153 | if (!inited_flag) { | 605 | 143 | vec_counts.resize(arg_size); | 606 | 143 | vec_quantile.resize(arg_size, -1); | 607 | 143 | inited_flag = true; | 608 | 292 | for (int i = 0; i < arg_size; ++i) { | 609 | | // throw Exception func call percentile_array(id, [1,0,null]) | 610 | 149 | if (null_maps[i]) { | 611 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 612 | 0 | "quantiles in func percentile_array should not have null"); | 613 | 0 | } | 614 | 149 | check_quantile(quantiles[i]); | 615 | 149 | vec_quantile[i] = quantiles[i]; | 616 | 149 | } | 617 | 143 | } | 618 | 313 | for (int i = 0; i < arg_size; ++i) { | 619 | 160 | vec_counts[i].increment(source); | 620 | 160 | } | 621 | 153 | } |
|
622 | | |
623 | | void add_batch(const PaddedPODArray<typename PrimitiveTypeTraits<T>::CppType>& source, |
624 | 0 | const Float64& q) { |
625 | 0 | if (!inited_flag) { |
626 | 0 | inited_flag = true; |
627 | 0 | vec_counts.resize(1); |
628 | 0 | vec_quantile.resize(1); |
629 | 0 | check_quantile(q); |
630 | 0 | vec_quantile[0] = q; |
631 | 0 | } |
632 | 0 | vec_counts[0].increment_batch(source); |
633 | 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 |
634 | | |
635 | 487 | void merge(const PercentileState& rhs) { |
636 | 487 | if (rhs.vec_counts.empty()) { |
637 | 44 | return; |
638 | 44 | } |
639 | 443 | int size_num = cast_set<int>(rhs.vec_quantile.size()); |
640 | 443 | if (vec_counts.empty()) { |
641 | 247 | vec_counts.resize(size_num); |
642 | 247 | vec_quantile = rhs.vec_quantile; |
643 | 247 | inited_flag = true; |
644 | 247 | } else if (UNLIKELY(vec_quantile != rhs.vec_quantile)) { |
645 | 36 | throw Exception(ErrorCode::INVALID_ARGUMENT, |
646 | 36 | "percentile aggregate states have incompatible quantiles"); |
647 | 36 | } |
648 | | |
649 | 1.04k | for (int i = 0; i < size_num; ++i) { |
650 | 642 | vec_counts[i].merge(&(rhs.vec_counts[i])); |
651 | 642 | } |
652 | 407 | } _ZN5doris15PercentileStateILNS_13PrimitiveTypeE3EE5mergeERKS2_ Line | Count | Source | 635 | 38 | void merge(const PercentileState& rhs) { | 636 | 38 | if (rhs.vec_counts.empty()) { | 637 | 4 | return; | 638 | 4 | } | 639 | 34 | int size_num = cast_set<int>(rhs.vec_quantile.size()); | 640 | 34 | if (vec_counts.empty()) { | 641 | 22 | vec_counts.resize(size_num); | 642 | 22 | vec_quantile = rhs.vec_quantile; | 643 | 22 | inited_flag = true; | 644 | 22 | } else if (UNLIKELY(vec_quantile != rhs.vec_quantile)) { | 645 | 12 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 646 | 12 | "percentile aggregate states have incompatible quantiles"); | 647 | 12 | } | 648 | | | 649 | 46 | for (int i = 0; i < size_num; ++i) { | 650 | 24 | vec_counts[i].merge(&(rhs.vec_counts[i])); | 651 | 24 | } | 652 | 22 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE4EE5mergeERKS2_ _ZN5doris15PercentileStateILNS_13PrimitiveTypeE5EE5mergeERKS2_ Line | Count | Source | 635 | 121 | void merge(const PercentileState& rhs) { | 636 | 121 | if (rhs.vec_counts.empty()) { | 637 | 8 | return; | 638 | 8 | } | 639 | 113 | int size_num = cast_set<int>(rhs.vec_quantile.size()); | 640 | 113 | if (vec_counts.empty()) { | 641 | 52 | vec_counts.resize(size_num); | 642 | 52 | vec_quantile = rhs.vec_quantile; | 643 | 52 | inited_flag = true; | 644 | 61 | } else if (UNLIKELY(vec_quantile != rhs.vec_quantile)) { | 645 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 646 | 0 | "percentile aggregate states have incompatible quantiles"); | 647 | 0 | } | 648 | | | 649 | 452 | for (int i = 0; i < size_num; ++i) { | 650 | 339 | vec_counts[i].merge(&(rhs.vec_counts[i])); | 651 | 339 | } | 652 | 113 | } |
_ZN5doris15PercentileStateILNS_13PrimitiveTypeE6EE5mergeERKS2_ Line | Count | Source | 635 | 223 | void merge(const PercentileState& rhs) { | 636 | 223 | if (rhs.vec_counts.empty()) { | 637 | 0 | return; | 638 | 0 | } | 639 | 223 | int size_num = cast_set<int>(rhs.vec_quantile.size()); | 640 | 223 | if (vec_counts.empty()) { | 641 | 134 | vec_counts.resize(size_num); | 642 | 134 | vec_quantile = rhs.vec_quantile; | 643 | 134 | inited_flag = true; | 644 | 134 | } else if (UNLIKELY(vec_quantile != rhs.vec_quantile)) { | 645 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 646 | 0 | "percentile aggregate states have incompatible quantiles"); | 647 | 0 | } | 648 | | | 649 | 446 | for (int i = 0; i < size_num; ++i) { | 650 | 223 | vec_counts[i].merge(&(rhs.vec_counts[i])); | 651 | 223 | } | 652 | 223 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE7EE5mergeERKS2_ Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE8EE5mergeERKS2_ _ZN5doris15PercentileStateILNS_13PrimitiveTypeE9EE5mergeERKS2_ Line | Count | Source | 635 | 105 | void merge(const PercentileState& rhs) { | 636 | 105 | if (rhs.vec_counts.empty()) { | 637 | 32 | return; | 638 | 32 | } | 639 | 73 | int size_num = cast_set<int>(rhs.vec_quantile.size()); | 640 | 73 | if (vec_counts.empty()) { | 641 | 39 | vec_counts.resize(size_num); | 642 | 39 | vec_quantile = rhs.vec_quantile; | 643 | 39 | inited_flag = true; | 644 | 39 | } else if (UNLIKELY(vec_quantile != rhs.vec_quantile)) { | 645 | 24 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 646 | 24 | "percentile aggregate states have incompatible quantiles"); | 647 | 24 | } | 648 | | | 649 | 105 | for (int i = 0; i < size_num; ++i) { | 650 | 56 | vec_counts[i].merge(&(rhs.vec_counts[i])); | 651 | 56 | } | 652 | 49 | } |
|
653 | | |
654 | 118 | void reset() { |
655 | 118 | vec_counts.clear(); |
656 | 118 | vec_quantile.clear(); |
657 | 118 | inited_flag = false; |
658 | 118 | } Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE3EE5resetEv Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE4EE5resetEv _ZN5doris15PercentileStateILNS_13PrimitiveTypeE5EE5resetEv Line | Count | Source | 654 | 26 | void reset() { | 655 | 26 | vec_counts.clear(); | 656 | 26 | vec_quantile.clear(); | 657 | 26 | inited_flag = false; | 658 | 26 | } |
_ZN5doris15PercentileStateILNS_13PrimitiveTypeE6EE5resetEv Line | Count | Source | 654 | 85 | void reset() { | 655 | 85 | vec_counts.clear(); | 656 | 85 | vec_quantile.clear(); | 657 | 85 | inited_flag = false; | 658 | 85 | } |
Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE7EE5resetEv Unexecuted instantiation: _ZN5doris15PercentileStateILNS_13PrimitiveTypeE8EE5resetEv _ZN5doris15PercentileStateILNS_13PrimitiveTypeE9EE5resetEv Line | Count | Source | 654 | 7 | void reset() { | 655 | 7 | vec_counts.clear(); | 656 | 7 | vec_quantile.clear(); | 657 | 7 | inited_flag = false; | 658 | 7 | } |
|
659 | | |
660 | 52 | 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 | 660 | 24 | double get() const { return vec_counts.empty() ? 0 : vec_counts[0].terminate(vec_quantile[0]); } |
Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE7EE3getEv Unexecuted instantiation: _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE8EE3getEv _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE9EE3getEv Line | Count | Source | 660 | 28 | double get() const { return vec_counts.empty() ? 0 : vec_counts[0].terminate(vec_quantile[0]); } |
|
661 | | |
662 | 80 | void insert_result_into(IColumn& to) const { |
663 | 80 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); |
664 | 166 | for (int i = 0; i < vec_counts.size(); ++i) { |
665 | 86 | column_data.push_back(vec_counts[i].terminate(vec_quantile[i])); |
666 | 86 | } |
667 | 80 | } _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE3EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 662 | 4 | void insert_result_into(IColumn& to) const { | 663 | 4 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); | 664 | 8 | for (int i = 0; i < vec_counts.size(); ++i) { | 665 | 4 | column_data.push_back(vec_counts[i].terminate(vec_quantile[i])); | 666 | 4 | } | 667 | 4 | } |
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 _ZNK5doris15PercentileStateILNS_13PrimitiveTypeE9EE18insert_result_intoERNS_7IColumnE Line | Count | Source | 662 | 76 | void insert_result_into(IColumn& to) const { | 663 | 76 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); | 664 | 158 | for (int i = 0; i < vec_counts.size(); ++i) { | 665 | 82 | column_data.push_back(vec_counts[i].terminate(vec_quantile[i])); | 666 | 82 | } | 667 | 76 | } |
|
668 | | }; |
669 | | |
670 | | template <PrimitiveType T> |
671 | | struct PercentileExactState { |
672 | | using ValueType = typename PrimitiveTypeTraits<T>::CppType; |
673 | | static constexpr size_t bytes_in_arena = 64 - sizeof(PODArray<ValueType>); |
674 | | using Array = PODArrayWithStackMemory<ValueType, bytes_in_arena>; |
675 | | |
676 | 1.24k | void add_single_range(const ValueType* data, size_t count, double quantile) { |
677 | 1.24k | if (!inited_flag) { |
678 | 662 | _set_single_level(quantile); |
679 | 662 | inited_flag = true; |
680 | 662 | } |
681 | 1.24k | _append(data, count); |
682 | 1.24k | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE16add_single_rangeEPKamd Line | Count | Source | 676 | 31 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 677 | 31 | if (!inited_flag) { | 678 | 6 | _set_single_level(quantile); | 679 | 6 | inited_flag = true; | 680 | 6 | } | 681 | 31 | _append(data, count); | 682 | 31 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE16add_single_rangeEPKsmd Line | Count | Source | 676 | 311 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 677 | 311 | if (!inited_flag) { | 678 | 100 | _set_single_level(quantile); | 679 | 100 | inited_flag = true; | 680 | 100 | } | 681 | 311 | _append(data, count); | 682 | 311 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE16add_single_rangeEPKimd Line | Count | Source | 676 | 264 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 677 | 264 | if (!inited_flag) { | 678 | 78 | _set_single_level(quantile); | 679 | 78 | inited_flag = true; | 680 | 78 | } | 681 | 264 | _append(data, count); | 682 | 264 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE16add_single_rangeEPKlmd Line | Count | Source | 676 | 196 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 677 | 196 | if (!inited_flag) { | 678 | 111 | _set_single_level(quantile); | 679 | 111 | inited_flag = true; | 680 | 111 | } | 681 | 196 | _append(data, count); | 682 | 196 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE16add_single_rangeEPKnmd Line | Count | Source | 676 | 3 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 677 | 3 | if (!inited_flag) { | 678 | 2 | _set_single_level(quantile); | 679 | 2 | inited_flag = true; | 680 | 2 | } | 681 | 3 | _append(data, count); | 682 | 3 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE16add_single_rangeEPKfmd Line | Count | Source | 676 | 6 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 677 | 6 | if (!inited_flag) { | 678 | 3 | _set_single_level(quantile); | 679 | 3 | inited_flag = true; | 680 | 3 | } | 681 | 6 | _append(data, count); | 682 | 6 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE16add_single_rangeEPKdmd Line | Count | Source | 676 | 433 | void add_single_range(const ValueType* data, size_t count, double quantile) { | 677 | 433 | if (!inited_flag) { | 678 | 362 | _set_single_level(quantile); | 679 | 362 | inited_flag = true; | 680 | 362 | } | 681 | 433 | _append(data, count); | 682 | 433 | } |
|
683 | | |
684 | | void add_many_range(const ValueType* data, size_t count, |
685 | | const PaddedPODArray<Float64>& quantiles_data, const NullMap& null_maps, |
686 | 928 | size_t start, int64_t arg_size) { |
687 | 928 | if (!inited_flag) { |
688 | 504 | _set_many_levels(quantiles_data, null_maps, start, arg_size); |
689 | 504 | inited_flag = true; |
690 | 504 | } |
691 | 928 | if (levels.empty()) { |
692 | 13 | return; |
693 | 13 | } |
694 | 915 | _append(data, count); |
695 | 915 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE14add_many_rangeEPKamRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 686 | 14 | size_t start, int64_t arg_size) { | 687 | 14 | if (!inited_flag) { | 688 | 12 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 689 | 12 | inited_flag = true; | 690 | 12 | } | 691 | 14 | if (levels.empty()) { | 692 | 0 | return; | 693 | 0 | } | 694 | 14 | _append(data, count); | 695 | 14 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE14add_many_rangeEPKsmRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 686 | 30 | size_t start, int64_t arg_size) { | 687 | 30 | if (!inited_flag) { | 688 | 14 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 689 | 14 | inited_flag = true; | 690 | 14 | } | 691 | 30 | if (levels.empty()) { | 692 | 0 | return; | 693 | 0 | } | 694 | 30 | _append(data, count); | 695 | 30 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE14add_many_rangeEPKimRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 686 | 517 | size_t start, int64_t arg_size) { | 687 | 517 | if (!inited_flag) { | 688 | 194 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 689 | 194 | inited_flag = true; | 690 | 194 | } | 691 | 517 | if (levels.empty()) { | 692 | 0 | return; | 693 | 0 | } | 694 | 517 | _append(data, count); | 695 | 517 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE14add_many_rangeEPKlmRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 686 | 33 | size_t start, int64_t arg_size) { | 687 | 33 | if (!inited_flag) { | 688 | 16 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 689 | 16 | inited_flag = true; | 690 | 16 | } | 691 | 33 | if (levels.empty()) { | 692 | 0 | return; | 693 | 0 | } | 694 | 33 | _append(data, count); | 695 | 33 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE14add_many_rangeEPKnmRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 686 | 15 | size_t start, int64_t arg_size) { | 687 | 15 | if (!inited_flag) { | 688 | 12 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 689 | 12 | inited_flag = true; | 690 | 12 | } | 691 | 15 | if (levels.empty()) { | 692 | 0 | return; | 693 | 0 | } | 694 | 15 | _append(data, count); | 695 | 15 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE14add_many_rangeEPKfmRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 686 | 3 | size_t start, int64_t arg_size) { | 687 | 3 | if (!inited_flag) { | 688 | 2 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 689 | 2 | inited_flag = true; | 690 | 2 | } | 691 | 3 | if (levels.empty()) { | 692 | 0 | return; | 693 | 0 | } | 694 | 3 | _append(data, count); | 695 | 3 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE14add_many_rangeEPKdmRKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS5_IhLm4096ES8_Lm16ELm15EEEml Line | Count | Source | 686 | 316 | size_t start, int64_t arg_size) { | 687 | 316 | if (!inited_flag) { | 688 | 254 | _set_many_levels(quantiles_data, null_maps, start, arg_size); | 689 | 254 | inited_flag = true; | 690 | 254 | } | 691 | 316 | if (levels.empty()) { | 692 | 13 | return; | 693 | 13 | } | 694 | 303 | _append(data, count); | 695 | 303 | } |
|
696 | | |
697 | 496 | void write(BufferWritable& buf) const { |
698 | 496 | buf.write_binary(inited_flag); |
699 | 496 | if (!inited_flag) { |
700 | 43 | return; |
701 | 43 | } |
702 | | |
703 | 453 | levels.write(buf); |
704 | 453 | size_t size = values.size(); |
705 | 453 | buf.write_binary(size); |
706 | 453 | if (size > 0) { |
707 | 413 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); |
708 | 413 | } |
709 | 453 | } _ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE5writeERNS_14BufferWritableE Line | Count | Source | 697 | 4 | void write(BufferWritable& buf) const { | 698 | 4 | buf.write_binary(inited_flag); | 699 | 4 | if (!inited_flag) { | 700 | 0 | return; | 701 | 0 | } | 702 | | | 703 | 4 | levels.write(buf); | 704 | 4 | size_t size = values.size(); | 705 | 4 | buf.write_binary(size); | 706 | 4 | if (size > 0) { | 707 | 4 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 708 | 4 | } | 709 | 4 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE5writeERNS_14BufferWritableE Line | Count | Source | 697 | 6 | void write(BufferWritable& buf) const { | 698 | 6 | buf.write_binary(inited_flag); | 699 | 6 | if (!inited_flag) { | 700 | 0 | return; | 701 | 0 | } | 702 | | | 703 | 6 | levels.write(buf); | 704 | 6 | size_t size = values.size(); | 705 | 6 | buf.write_binary(size); | 706 | 6 | if (size > 0) { | 707 | 6 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 708 | 6 | } | 709 | 6 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE5writeERNS_14BufferWritableE Line | Count | Source | 697 | 203 | void write(BufferWritable& buf) const { | 698 | 203 | buf.write_binary(inited_flag); | 699 | 203 | if (!inited_flag) { | 700 | 1 | return; | 701 | 1 | } | 702 | | | 703 | 202 | levels.write(buf); | 704 | 202 | size_t size = values.size(); | 705 | 202 | buf.write_binary(size); | 706 | 202 | if (size > 0) { | 707 | 202 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 708 | 202 | } | 709 | 202 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE5writeERNS_14BufferWritableE Line | Count | Source | 697 | 90 | void write(BufferWritable& buf) const { | 698 | 90 | buf.write_binary(inited_flag); | 699 | 90 | if (!inited_flag) { | 700 | 0 | return; | 701 | 0 | } | 702 | | | 703 | 90 | levels.write(buf); | 704 | 90 | size_t size = values.size(); | 705 | 90 | buf.write_binary(size); | 706 | 90 | if (size > 0) { | 707 | 90 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 708 | 90 | } | 709 | 90 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE5writeERNS_14BufferWritableE Line | Count | Source | 697 | 4 | void write(BufferWritable& buf) const { | 698 | 4 | buf.write_binary(inited_flag); | 699 | 4 | if (!inited_flag) { | 700 | 0 | return; | 701 | 0 | } | 702 | | | 703 | 4 | levels.write(buf); | 704 | 4 | size_t size = values.size(); | 705 | 4 | buf.write_binary(size); | 706 | 4 | if (size > 0) { | 707 | 4 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 708 | 4 | } | 709 | 4 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE5writeERNS_14BufferWritableE Line | Count | Source | 697 | 5 | void write(BufferWritable& buf) const { | 698 | 5 | buf.write_binary(inited_flag); | 699 | 5 | if (!inited_flag) { | 700 | 0 | return; | 701 | 0 | } | 702 | | | 703 | 5 | levels.write(buf); | 704 | 5 | size_t size = values.size(); | 705 | 5 | buf.write_binary(size); | 706 | 5 | if (size > 0) { | 707 | 5 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 708 | 5 | } | 709 | 5 | } |
_ZNK5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE5writeERNS_14BufferWritableE Line | Count | Source | 697 | 184 | void write(BufferWritable& buf) const { | 698 | 184 | buf.write_binary(inited_flag); | 699 | 184 | if (!inited_flag) { | 700 | 42 | return; | 701 | 42 | } | 702 | | | 703 | 142 | levels.write(buf); | 704 | 142 | size_t size = values.size(); | 705 | 142 | buf.write_binary(size); | 706 | 142 | if (size > 0) { | 707 | 102 | buf.write(reinterpret_cast<const char*>(values.data()), sizeof(ValueType) * size); | 708 | 102 | } | 709 | 142 | } |
|
710 | | |
711 | 508 | void read(BufferReadable& buf) { |
712 | 508 | reset(); |
713 | 508 | buf.read_binary(inited_flag); |
714 | 508 | if (!inited_flag) { |
715 | 43 | return; |
716 | 43 | } |
717 | | |
718 | 465 | levels.read(buf); |
719 | 465 | size_t size = 0; |
720 | 465 | buf.read_binary(size); |
721 | 465 | values.resize(size); |
722 | 465 | if (size > 0) { |
723 | 425 | auto raw = buf.read(sizeof(ValueType) * size); |
724 | 425 | memcpy(values.data(), raw.data, raw.size); |
725 | 425 | } |
726 | 465 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE4readERNS_14BufferReadableE Line | Count | Source | 711 | 4 | void read(BufferReadable& buf) { | 712 | 4 | reset(); | 713 | 4 | buf.read_binary(inited_flag); | 714 | 4 | if (!inited_flag) { | 715 | 0 | return; | 716 | 0 | } | 717 | | | 718 | 4 | levels.read(buf); | 719 | 4 | size_t size = 0; | 720 | 4 | buf.read_binary(size); | 721 | 4 | values.resize(size); | 722 | 4 | if (size > 0) { | 723 | 4 | auto raw = buf.read(sizeof(ValueType) * size); | 724 | 4 | memcpy(values.data(), raw.data, raw.size); | 725 | 4 | } | 726 | 4 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE4readERNS_14BufferReadableE Line | Count | Source | 711 | 6 | void read(BufferReadable& buf) { | 712 | 6 | reset(); | 713 | 6 | buf.read_binary(inited_flag); | 714 | 6 | if (!inited_flag) { | 715 | 0 | return; | 716 | 0 | } | 717 | | | 718 | 6 | levels.read(buf); | 719 | 6 | size_t size = 0; | 720 | 6 | buf.read_binary(size); | 721 | 6 | values.resize(size); | 722 | 6 | if (size > 0) { | 723 | 6 | auto raw = buf.read(sizeof(ValueType) * size); | 724 | 6 | memcpy(values.data(), raw.data, raw.size); | 725 | 6 | } | 726 | 6 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE4readERNS_14BufferReadableE Line | Count | Source | 711 | 203 | void read(BufferReadable& buf) { | 712 | 203 | reset(); | 713 | 203 | buf.read_binary(inited_flag); | 714 | 203 | if (!inited_flag) { | 715 | 1 | return; | 716 | 1 | } | 717 | | | 718 | 202 | levels.read(buf); | 719 | 202 | size_t size = 0; | 720 | 202 | buf.read_binary(size); | 721 | 202 | values.resize(size); | 722 | 202 | if (size > 0) { | 723 | 202 | auto raw = buf.read(sizeof(ValueType) * size); | 724 | 202 | memcpy(values.data(), raw.data, raw.size); | 725 | 202 | } | 726 | 202 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE4readERNS_14BufferReadableE Line | Count | Source | 711 | 90 | void read(BufferReadable& buf) { | 712 | 90 | reset(); | 713 | 90 | buf.read_binary(inited_flag); | 714 | 90 | if (!inited_flag) { | 715 | 0 | return; | 716 | 0 | } | 717 | | | 718 | 90 | levels.read(buf); | 719 | 90 | size_t size = 0; | 720 | 90 | buf.read_binary(size); | 721 | 90 | values.resize(size); | 722 | 90 | if (size > 0) { | 723 | 90 | auto raw = buf.read(sizeof(ValueType) * size); | 724 | 90 | memcpy(values.data(), raw.data, raw.size); | 725 | 90 | } | 726 | 90 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE4readERNS_14BufferReadableE Line | Count | Source | 711 | 4 | void read(BufferReadable& buf) { | 712 | 4 | reset(); | 713 | 4 | buf.read_binary(inited_flag); | 714 | 4 | if (!inited_flag) { | 715 | 0 | return; | 716 | 0 | } | 717 | | | 718 | 4 | levels.read(buf); | 719 | 4 | size_t size = 0; | 720 | 4 | buf.read_binary(size); | 721 | 4 | values.resize(size); | 722 | 4 | if (size > 0) { | 723 | 4 | auto raw = buf.read(sizeof(ValueType) * size); | 724 | 4 | memcpy(values.data(), raw.data, raw.size); | 725 | 4 | } | 726 | 4 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE4readERNS_14BufferReadableE Line | Count | Source | 711 | 5 | void read(BufferReadable& buf) { | 712 | 5 | reset(); | 713 | 5 | buf.read_binary(inited_flag); | 714 | 5 | if (!inited_flag) { | 715 | 0 | return; | 716 | 0 | } | 717 | | | 718 | 5 | levels.read(buf); | 719 | 5 | size_t size = 0; | 720 | 5 | buf.read_binary(size); | 721 | 5 | values.resize(size); | 722 | 5 | if (size > 0) { | 723 | 5 | auto raw = buf.read(sizeof(ValueType) * size); | 724 | 5 | memcpy(values.data(), raw.data, raw.size); | 725 | 5 | } | 726 | 5 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE4readERNS_14BufferReadableE Line | Count | Source | 711 | 196 | void read(BufferReadable& buf) { | 712 | 196 | reset(); | 713 | 196 | buf.read_binary(inited_flag); | 714 | 196 | if (!inited_flag) { | 715 | 42 | return; | 716 | 42 | } | 717 | | | 718 | 154 | levels.read(buf); | 719 | 154 | size_t size = 0; | 720 | 154 | buf.read_binary(size); | 721 | 154 | values.resize(size); | 722 | 154 | if (size > 0) { | 723 | 114 | auto raw = buf.read(sizeof(ValueType) * size); | 724 | 114 | memcpy(values.data(), raw.data, raw.size); | 725 | 114 | } | 726 | 154 | } |
|
727 | | |
728 | 661 | void merge(const PercentileExactState& rhs) { |
729 | 661 | if (!rhs.inited_flag) { |
730 | 85 | return; |
731 | 85 | } |
732 | | |
733 | 576 | if (values.empty()) { |
734 | 390 | levels = rhs.levels; |
735 | 390 | inited_flag = true; |
736 | 390 | } else if (rhs.values.empty()) { |
737 | 18 | return; |
738 | 168 | } else if (UNLIKELY(levels.quantiles != rhs.levels.quantiles)) { |
739 | 24 | throw Exception(ErrorCode::INVALID_ARGUMENT, |
740 | 24 | "percentile aggregate states have incompatible quantiles"); |
741 | 24 | } |
742 | 534 | _append(rhs.values.data(), rhs.values.size()); |
743 | 534 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE5mergeERKS2_ Line | Count | Source | 728 | 4 | void merge(const PercentileExactState& rhs) { | 729 | 4 | if (!rhs.inited_flag) { | 730 | 0 | return; | 731 | 0 | } | 732 | | | 733 | 4 | if (values.empty()) { | 734 | 2 | levels = rhs.levels; | 735 | 2 | inited_flag = true; | 736 | 2 | } else if (rhs.values.empty()) { | 737 | 0 | return; | 738 | 2 | } else if (UNLIKELY(levels.quantiles != rhs.levels.quantiles)) { | 739 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 740 | 0 | "percentile aggregate states have incompatible quantiles"); | 741 | 0 | } | 742 | 4 | _append(rhs.values.data(), rhs.values.size()); | 743 | 4 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE5mergeERKS2_ Line | Count | Source | 728 | 6 | void merge(const PercentileExactState& rhs) { | 729 | 6 | if (!rhs.inited_flag) { | 730 | 0 | return; | 731 | 0 | } | 732 | | | 733 | 6 | if (values.empty()) { | 734 | 3 | levels = rhs.levels; | 735 | 3 | inited_flag = true; | 736 | 3 | } else if (rhs.values.empty()) { | 737 | 0 | return; | 738 | 3 | } else if (UNLIKELY(levels.quantiles != rhs.levels.quantiles)) { | 739 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 740 | 0 | "percentile aggregate states have incompatible quantiles"); | 741 | 0 | } | 742 | 6 | _append(rhs.values.data(), rhs.values.size()); | 743 | 6 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE5mergeERKS2_ Line | Count | Source | 728 | 203 | void merge(const PercentileExactState& rhs) { | 729 | 203 | if (!rhs.inited_flag) { | 730 | 1 | return; | 731 | 1 | } | 732 | | | 733 | 202 | if (values.empty()) { | 734 | 170 | levels = rhs.levels; | 735 | 170 | inited_flag = true; | 736 | 170 | } else if (rhs.values.empty()) { | 737 | 0 | return; | 738 | 32 | } else if (UNLIKELY(levels.quantiles != rhs.levels.quantiles)) { | 739 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 740 | 0 | "percentile aggregate states have incompatible quantiles"); | 741 | 0 | } | 742 | 202 | _append(rhs.values.data(), rhs.values.size()); | 743 | 202 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE5mergeERKS2_ Line | Count | Source | 728 | 90 | void merge(const PercentileExactState& rhs) { | 729 | 90 | if (!rhs.inited_flag) { | 730 | 0 | return; | 731 | 0 | } | 732 | | | 733 | 90 | if (values.empty()) { | 734 | 44 | levels = rhs.levels; | 735 | 44 | inited_flag = true; | 736 | 46 | } else if (rhs.values.empty()) { | 737 | 0 | return; | 738 | 46 | } else if (UNLIKELY(levels.quantiles != rhs.levels.quantiles)) { | 739 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 740 | 0 | "percentile aggregate states have incompatible quantiles"); | 741 | 0 | } | 742 | 90 | _append(rhs.values.data(), rhs.values.size()); | 743 | 90 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE5mergeERKS2_ Line | Count | Source | 728 | 4 | void merge(const PercentileExactState& rhs) { | 729 | 4 | if (!rhs.inited_flag) { | 730 | 0 | return; | 731 | 0 | } | 732 | | | 733 | 4 | if (values.empty()) { | 734 | 2 | levels = rhs.levels; | 735 | 2 | inited_flag = true; | 736 | 2 | } else if (rhs.values.empty()) { | 737 | 0 | return; | 738 | 2 | } else if (UNLIKELY(levels.quantiles != rhs.levels.quantiles)) { | 739 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 740 | 0 | "percentile aggregate states have incompatible quantiles"); | 741 | 0 | } | 742 | 4 | _append(rhs.values.data(), rhs.values.size()); | 743 | 4 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE5mergeERKS2_ Line | Count | Source | 728 | 5 | void merge(const PercentileExactState& rhs) { | 729 | 5 | if (!rhs.inited_flag) { | 730 | 0 | return; | 731 | 0 | } | 732 | | | 733 | 5 | if (values.empty()) { | 734 | 3 | levels = rhs.levels; | 735 | 3 | inited_flag = true; | 736 | 3 | } else if (rhs.values.empty()) { | 737 | 0 | return; | 738 | 2 | } else if (UNLIKELY(levels.quantiles != rhs.levels.quantiles)) { | 739 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 740 | 0 | "percentile aggregate states have incompatible quantiles"); | 741 | 0 | } | 742 | 5 | _append(rhs.values.data(), rhs.values.size()); | 743 | 5 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE5mergeERKS2_ Line | Count | Source | 728 | 349 | void merge(const PercentileExactState& rhs) { | 729 | 349 | if (!rhs.inited_flag) { | 730 | 84 | return; | 731 | 84 | } | 732 | | | 733 | 265 | if (values.empty()) { | 734 | 166 | levels = rhs.levels; | 735 | 166 | inited_flag = true; | 736 | 166 | } else if (rhs.values.empty()) { | 737 | 18 | return; | 738 | 81 | } else if (UNLIKELY(levels.quantiles != rhs.levels.quantiles)) { | 739 | 24 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 740 | 24 | "percentile aggregate states have incompatible quantiles"); | 741 | 24 | } | 742 | 223 | _append(rhs.values.data(), rhs.values.size()); | 743 | 223 | } |
|
744 | | |
745 | 643 | void reset() { |
746 | 643 | values.clear(); |
747 | 643 | levels.clear(); |
748 | 643 | inited_flag = false; |
749 | 643 | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE5resetEv Line | Count | Source | 745 | 4 | void reset() { | 746 | 4 | values.clear(); | 747 | 4 | levels.clear(); | 748 | 4 | inited_flag = false; | 749 | 4 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE5resetEv Line | Count | Source | 745 | 111 | void reset() { | 746 | 111 | values.clear(); | 747 | 111 | levels.clear(); | 748 | 111 | inited_flag = false; | 749 | 111 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE5resetEv Line | Count | Source | 745 | 212 | void reset() { | 746 | 212 | values.clear(); | 747 | 212 | levels.clear(); | 748 | 212 | inited_flag = false; | 749 | 212 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE5resetEv Line | Count | Source | 745 | 90 | void reset() { | 746 | 90 | values.clear(); | 747 | 90 | levels.clear(); | 748 | 90 | inited_flag = false; | 749 | 90 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE5resetEv Line | Count | Source | 745 | 4 | void reset() { | 746 | 4 | values.clear(); | 747 | 4 | levels.clear(); | 748 | 4 | inited_flag = false; | 749 | 4 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE5resetEv Line | Count | Source | 745 | 5 | void reset() { | 746 | 5 | values.clear(); | 747 | 5 | levels.clear(); | 748 | 5 | inited_flag = false; | 749 | 5 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE5resetEv Line | Count | Source | 745 | 217 | void reset() { | 746 | 217 | values.clear(); | 747 | 217 | levels.clear(); | 748 | 217 | inited_flag = false; | 749 | 217 | } |
|
750 | | |
751 | 631 | double get() const { |
752 | 631 | if (!inited_flag || levels.empty() || values.empty()) { |
753 | 135 | return std::numeric_limits<double>::quiet_NaN(); |
754 | 135 | } |
755 | | |
756 | 631 | DCHECK_EQ(levels.quantiles.size(), 1); |
757 | 496 | return _get_result(levels.quantiles[0]); |
758 | 631 | } _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 | 291 | double get() const { | 752 | 291 | if (!inited_flag || levels.empty() || values.empty()) { | 753 | 133 | return std::numeric_limits<double>::quiet_NaN(); | 754 | 133 | } | 755 | | | 756 | 291 | DCHECK_EQ(levels.quantiles.size(), 1); | 757 | 158 | return _get_result(levels.quantiles[0]); | 758 | 291 | } |
|
759 | | |
760 | 428 | void insert_result_into(IColumn& to) const { |
761 | 428 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); |
762 | 428 | if (!inited_flag || levels.empty()) { |
763 | 22 | return; |
764 | 22 | } |
765 | | |
766 | 406 | size_t old_size = column_data.size(); |
767 | 406 | size_t size = levels.quantiles.size(); |
768 | 406 | column_data.resize(old_size + size); |
769 | 406 | auto* result = column_data.data() + old_size; |
770 | | |
771 | 406 | if (values.empty()) { |
772 | 84 | for (size_t i = 0; i < size; ++i) { |
773 | 43 | result[i] = std::numeric_limits<double>::quiet_NaN(); |
774 | 43 | } |
775 | 41 | return; |
776 | 41 | } |
777 | | |
778 | 365 | if (values.size() == 1) { |
779 | 608 | for (size_t i = 0; i < size; ++i) { |
780 | 404 | result[i] = static_cast<double>(values.front()); |
781 | 404 | } |
782 | 204 | return; |
783 | 204 | } |
784 | | |
785 | 161 | size_t prev_index = 0; |
786 | 161 | const auto& quantiles = levels.quantiles; |
787 | 161 | const auto& permutation = levels.get_permutation(); |
788 | 515 | for (size_t i = 0; i < size; ++i) { |
789 | 354 | auto level_index = permutation[i]; |
790 | 354 | auto level = quantiles[level_index]; |
791 | 354 | double u = static_cast<double>(values.size() - 1) * level; |
792 | 354 | auto index = static_cast<size_t>(u); |
793 | | |
794 | 354 | if (index + 1 >= values.size()) { |
795 | 0 | result[level_index] = |
796 | 0 | static_cast<double>(*std::max_element(values.begin(), values.end())); |
797 | 354 | } else { |
798 | 354 | std::nth_element(values.begin() + prev_index, values.begin() + index, values.end()); |
799 | 354 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); |
800 | 354 | result[level_index] = |
801 | 354 | static_cast<double>(values[index]) + |
802 | 354 | (u - static_cast<double>(index)) * (static_cast<double>(*nth_elem) - |
803 | 354 | static_cast<double>(values[index])); |
804 | 354 | prev_index = index; |
805 | 354 | } |
806 | 354 | } |
807 | 161 | } _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 | 196 | void insert_result_into(IColumn& to) const { | 761 | 196 | auto& column_data = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to).get_data(); | 762 | 196 | if (!inited_flag || levels.empty()) { | 763 | 13 | return; | 764 | 13 | } | 765 | | | 766 | 183 | size_t old_size = column_data.size(); | 767 | 183 | size_t size = levels.quantiles.size(); | 768 | 183 | column_data.resize(old_size + size); | 769 | 183 | auto* result = column_data.data() + old_size; | 770 | | | 771 | 183 | if (values.empty()) { | 772 | 84 | for (size_t i = 0; i < size; ++i) { | 773 | 43 | result[i] = std::numeric_limits<double>::quiet_NaN(); | 774 | 43 | } | 775 | 41 | return; | 776 | 41 | } | 777 | | | 778 | 142 | if (values.size() == 1) { | 779 | 183 | for (size_t i = 0; i < size; ++i) { | 780 | 102 | result[i] = static_cast<double>(values.front()); | 781 | 102 | } | 782 | 81 | return; | 783 | 81 | } | 784 | | | 785 | 61 | size_t prev_index = 0; | 786 | 61 | const auto& quantiles = levels.quantiles; | 787 | 61 | const auto& permutation = levels.get_permutation(); | 788 | 179 | for (size_t i = 0; i < size; ++i) { | 789 | 118 | auto level_index = permutation[i]; | 790 | 118 | auto level = quantiles[level_index]; | 791 | 118 | double u = static_cast<double>(values.size() - 1) * level; | 792 | 118 | auto index = static_cast<size_t>(u); | 793 | | | 794 | 118 | if (index + 1 >= values.size()) { | 795 | 0 | result[level_index] = | 796 | 0 | static_cast<double>(*std::max_element(values.begin(), values.end())); | 797 | 118 | } else { | 798 | 118 | std::nth_element(values.begin() + prev_index, values.begin() + index, values.end()); | 799 | 118 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 800 | 118 | result[level_index] = | 801 | 118 | static_cast<double>(values[index]) + | 802 | 118 | (u - static_cast<double>(index)) * (static_cast<double>(*nth_elem) - | 803 | 118 | static_cast<double>(values[index])); | 804 | 118 | prev_index = index; | 805 | 118 | } | 806 | 118 | } | 807 | 61 | } |
|
808 | | |
809 | | private: |
810 | 661 | void _set_single_level(double quantile) { |
811 | 661 | DCHECK(levels.empty()); |
812 | 661 | check_quantile(quantile); |
813 | 661 | levels.quantiles.push_back(quantile); |
814 | 661 | levels.permutation.push_back(0); |
815 | 661 | } _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 | 78 | void _set_single_level(double quantile) { | 811 | | DCHECK(levels.empty()); | 812 | 78 | check_quantile(quantile); | 813 | 78 | levels.quantiles.push_back(quantile); | 814 | 78 | levels.permutation.push_back(0); | 815 | 78 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE17_set_single_levelEd Line | Count | Source | 810 | 110 | void _set_single_level(double quantile) { | 811 | | DCHECK(levels.empty()); | 812 | 110 | check_quantile(quantile); | 813 | 110 | levels.quantiles.push_back(quantile); | 814 | 110 | levels.permutation.push_back(0); | 815 | 110 | } |
_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 | 362 | void _set_single_level(double quantile) { | 811 | | DCHECK(levels.empty()); | 812 | 362 | check_quantile(quantile); | 813 | 362 | levels.quantiles.push_back(quantile); | 814 | 362 | levels.permutation.push_back(0); | 815 | 362 | } |
|
816 | | |
817 | | void _set_many_levels(const PaddedPODArray<Float64>& quantiles_data, const NullMap& null_maps, |
818 | 503 | size_t start, int64_t arg_size) { |
819 | 503 | DCHECK(levels.empty()); |
820 | 503 | size_t size = cast_set<size_t>(arg_size); |
821 | 503 | levels.quantiles.resize(size); |
822 | 503 | levels.permutation.resize(size); |
823 | 1.41k | for (size_t i = 0; i < size; ++i) { |
824 | 915 | 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 | 914 | check_quantile(quantiles_data[start + i]); |
829 | 914 | levels.quantiles[i] = quantiles_data[start + i]; |
830 | 914 | levels.permutation[i] = i; |
831 | 914 | } |
832 | 503 | } _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 | 14 | size_t start, int64_t arg_size) { | 819 | 14 | DCHECK(levels.empty()); | 820 | 14 | size_t size = cast_set<size_t>(arg_size); | 821 | 14 | levels.quantiles.resize(size); | 822 | 14 | levels.permutation.resize(size); | 823 | 54 | for (size_t i = 0; i < size; ++i) { | 824 | 40 | 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 | 40 | check_quantile(quantiles_data[start + i]); | 829 | 40 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 40 | levels.permutation[i] = i; | 831 | 40 | } | 832 | 14 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 194 | size_t start, int64_t arg_size) { | 819 | 194 | DCHECK(levels.empty()); | 820 | 194 | size_t size = cast_set<size_t>(arg_size); | 821 | 194 | levels.quantiles.resize(size); | 822 | 194 | levels.permutation.resize(size); | 823 | 635 | for (size_t i = 0; i < size; ++i) { | 824 | 441 | 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 | 441 | check_quantile(quantiles_data[start + i]); | 829 | 441 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 441 | levels.permutation[i] = i; | 831 | 441 | } | 832 | 194 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 16 | size_t start, int64_t arg_size) { | 819 | 16 | DCHECK(levels.empty()); | 820 | 16 | size_t size = cast_set<size_t>(arg_size); | 821 | 16 | levels.quantiles.resize(size); | 822 | 16 | levels.permutation.resize(size); | 823 | 59 | for (size_t i = 0; i < size; ++i) { | 824 | 44 | 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 | 43 | check_quantile(quantiles_data[start + i]); | 829 | 43 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 43 | levels.permutation[i] = i; | 831 | 43 | } | 832 | 16 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE16_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 | 46 | for (size_t i = 0; i < size; ++i) { | 824 | 34 | 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 | 34 | check_quantile(quantiles_data[start + i]); | 829 | 34 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 34 | levels.permutation[i] = i; | 831 | 34 | } | 832 | 12 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 2 | size_t start, int64_t arg_size) { | 819 | 2 | DCHECK(levels.empty()); | 820 | 2 | size_t size = cast_set<size_t>(arg_size); | 821 | 2 | levels.quantiles.resize(size); | 822 | 2 | levels.permutation.resize(size); | 823 | 6 | for (size_t i = 0; i < size; ++i) { | 824 | 4 | 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 | 4 | check_quantile(quantiles_data[start + i]); | 829 | 4 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 4 | levels.permutation[i] = i; | 831 | 4 | } | 832 | 2 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE16_set_many_levelsERKNS_8PODArrayIdLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEERKNS3_IhLm4096ES6_Lm16ELm15EEEml Line | Count | Source | 818 | 254 | size_t start, int64_t arg_size) { | 819 | 254 | DCHECK(levels.empty()); | 820 | 254 | size_t size = cast_set<size_t>(arg_size); | 821 | 254 | levels.quantiles.resize(size); | 822 | 254 | levels.permutation.resize(size); | 823 | 574 | for (size_t i = 0; i < size; ++i) { | 824 | 320 | 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 | 320 | check_quantile(quantiles_data[start + i]); | 829 | 320 | levels.quantiles[i] = quantiles_data[start + i]; | 830 | 320 | levels.permutation[i] = i; | 831 | 320 | } | 832 | 254 | } |
|
833 | | |
834 | 2.68k | void _append(const ValueType* data, size_t count) { |
835 | 2.68k | if (count == 0) { |
836 | 72 | return; |
837 | 72 | } |
838 | 2.61k | values.reserve(values.size() + count); |
839 | 2.61k | if constexpr (std::is_floating_point_v<ValueType>) { |
840 | 1.81k | for (size_t i = 0; i < count; ++i) { |
841 | 920 | if (!std::isnan(data[i])) { |
842 | 633 | values.push_back(data[i]); |
843 | 633 | } |
844 | 920 | } |
845 | 1.71k | } else { |
846 | 1.71k | values.insert_assume_reserved(data, data + count); |
847 | 1.71k | } |
848 | 2.61k | } _ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE3EE7_appendEPKam Line | Count | Source | 834 | 50 | void _append(const ValueType* data, size_t count) { | 835 | 50 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 50 | 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 | 50 | } else { | 846 | 50 | values.insert_assume_reserved(data, data + count); | 847 | 50 | } | 848 | 50 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE4EE7_appendEPKsm Line | Count | Source | 834 | 347 | void _append(const ValueType* data, size_t count) { | 835 | 347 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 347 | 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 | 347 | } else { | 846 | 347 | values.insert_assume_reserved(data, data + count); | 847 | 347 | } | 848 | 347 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE5EE7_appendEPKim Line | Count | Source | 834 | 982 | void _append(const ValueType* data, size_t count) { | 835 | 982 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 982 | 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 | 982 | } else { | 846 | 982 | values.insert_assume_reserved(data, data + count); | 847 | 982 | } | 848 | 982 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE6EE7_appendEPKlm Line | Count | Source | 834 | 316 | void _append(const ValueType* data, size_t count) { | 835 | 316 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 316 | 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 | 316 | } else { | 846 | 316 | values.insert_assume_reserved(data, data + count); | 847 | 316 | } | 848 | 316 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE7EE7_appendEPKnm Line | Count | Source | 834 | 22 | void _append(const ValueType* data, size_t count) { | 835 | 22 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 22 | 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 | 22 | } else { | 846 | 22 | values.insert_assume_reserved(data, data + count); | 847 | 22 | } | 848 | 22 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE8EE7_appendEPKfm Line | Count | Source | 834 | 14 | void _append(const ValueType* data, size_t count) { | 835 | 14 | if (count == 0) { | 836 | 0 | return; | 837 | 0 | } | 838 | 14 | values.reserve(values.size() + count); | 839 | 14 | if constexpr (std::is_floating_point_v<ValueType>) { | 840 | 31 | for (size_t i = 0; i < count; ++i) { | 841 | 17 | if (!std::isnan(data[i])) { | 842 | 16 | values.push_back(data[i]); | 843 | 16 | } | 844 | 17 | } | 845 | | } else { | 846 | | values.insert_assume_reserved(data, data + count); | 847 | | } | 848 | 14 | } |
_ZN5doris20PercentileExactStateILNS_13PrimitiveTypeE9EE7_appendEPKdm Line | Count | Source | 834 | 951 | void _append(const ValueType* data, size_t count) { | 835 | 951 | if (count == 0) { | 836 | 72 | return; | 837 | 72 | } | 838 | 879 | values.reserve(values.size() + count); | 839 | 879 | if constexpr (std::is_floating_point_v<ValueType>) { | 840 | 1.78k | for (size_t i = 0; i < count; ++i) { | 841 | 903 | if (!std::isnan(data[i])) { | 842 | 617 | values.push_back(data[i]); | 843 | 617 | } | 844 | 903 | } | 845 | | } else { | 846 | | values.insert_assume_reserved(data, data + count); | 847 | | } | 848 | 879 | } |
|
849 | | |
850 | 496 | double _get_result(double quantile) const { |
851 | 496 | if (values.size() == 1) { |
852 | 198 | return static_cast<double>(values.front()); |
853 | 198 | } |
854 | | |
855 | 298 | double u = static_cast<double>(values.size() - 1) * quantile; |
856 | 298 | auto index = static_cast<size_t>(u); |
857 | | |
858 | 298 | if (index + 1 >= values.size()) { |
859 | 12 | return static_cast<double>(*std::max_element(values.begin(), values.end())); |
860 | 12 | } |
861 | | |
862 | 286 | std::nth_element(values.begin(), values.begin() + index, values.end()); |
863 | 286 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); |
864 | | |
865 | 286 | return static_cast<double>(values[index]) + |
866 | 286 | (u - static_cast<double>(index)) * |
867 | 286 | (static_cast<double>(*nth_elem) - static_cast<double>(values[index])); |
868 | 298 | } _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 | 158 | double _get_result(double quantile) const { | 851 | 158 | if (values.size() == 1) { | 852 | 96 | return static_cast<double>(values.front()); | 853 | 96 | } | 854 | | | 855 | 62 | double u = static_cast<double>(values.size() - 1) * quantile; | 856 | 62 | auto index = static_cast<size_t>(u); | 857 | | | 858 | 62 | if (index + 1 >= values.size()) { | 859 | 6 | return static_cast<double>(*std::max_element(values.begin(), values.end())); | 860 | 6 | } | 861 | | | 862 | 56 | std::nth_element(values.begin(), values.begin() + index, values.end()); | 863 | 56 | auto* nth_elem = std::min_element(values.begin() + index + 1, values.end()); | 864 | | | 865 | 56 | return static_cast<double>(values[index]) + | 866 | 56 | (u - static_cast<double>(index)) * | 867 | 56 | (static_cast<double>(*nth_elem) - static_cast<double>(values[index])); | 868 | 62 | } |
|
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 | 855 | AggregateFunctionPercentile(const DataTypes& argument_types_) : Base(argument_types_) {}_ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 883 | 38 | AggregateFunctionPercentile(const DataTypes& argument_types_) : Base(argument_types_) {} |
Unexecuted instantiation: _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 883 | 816 | AggregateFunctionPercentile(const DataTypes& argument_types_) : Base(argument_types_) {} |
Unexecuted instantiation: _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Unexecuted instantiation: _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE _ZN5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 883 | 1 | AggregateFunctionPercentile(const DataTypes& argument_types_) : Base(argument_types_) {} |
|
884 | | |
885 | 120 | 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 | 120 | String get_name() const override { return "percentile"; } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE8get_nameB5cxx11Ev |
886 | | |
887 | 79 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); }_ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE15get_return_typeEv Line | Count | Source | 887 | 10 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE15get_return_typeEv _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE15get_return_typeEv Line | Count | Source | 887 | 41 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE15get_return_typeEv Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE15get_return_typeEv _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE15get_return_typeEv Line | Count | Source | 887 | 28 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
|
888 | | |
889 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
890 | 170 | Arena&) const override { |
891 | 170 | const auto& sources = |
892 | 170 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
893 | 170 | const auto& quantile = |
894 | 170 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
895 | 170 | AggregateFunctionPercentile::data(place).add(sources.get_data()[row_num], |
896 | 170 | quantile.get_data(), NullMap(1, 0), 1); |
897 | 170 | } _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 890 | 8 | Arena&) const override { | 891 | 8 | const auto& sources = | 892 | 8 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 893 | 8 | const auto& quantile = | 894 | 8 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 895 | 8 | AggregateFunctionPercentile::data(place).add(sources.get_data()[row_num], | 896 | 8 | quantile.get_data(), NullMap(1, 0), 1); | 897 | 8 | } |
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 _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 890 | 40 | Arena&) const override { | 891 | 40 | const auto& sources = | 892 | 40 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 893 | 40 | const auto& quantile = | 894 | 40 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 895 | 40 | AggregateFunctionPercentile::data(place).add(sources.get_data()[row_num], | 896 | 40 | quantile.get_data(), NullMap(1, 0), 1); | 897 | 40 | } |
|
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 | 37 | void check_input_columns_type(const IColumn** columns) const override { |
911 | 37 | this->template check_argument_column_type<ColVecType>(columns[0]); |
912 | 37 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); |
913 | 37 | } _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 910 | 8 | void check_input_columns_type(const IColumn** columns) const override { | 911 | 8 | this->template check_argument_column_type<ColVecType>(columns[0]); | 912 | 8 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 913 | 8 | } |
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 | 87 | void reset(AggregateDataPtr __restrict place) const override { |
916 | 87 | AggregateFunctionPercentile::data(place).reset(); |
917 | 87 | } Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE5resetEPc Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE5resetEPc Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE5resetEPc _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE5resetEPc Line | Count | Source | 915 | 85 | void reset(AggregateDataPtr __restrict place) const override { | 916 | 85 | AggregateFunctionPercentile::data(place).reset(); | 917 | 85 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE5resetEPc Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE5resetEPc _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE5resetEPc Line | Count | Source | 915 | 2 | void reset(AggregateDataPtr __restrict place) const override { | 916 | 2 | AggregateFunctionPercentile::data(place).reset(); | 917 | 2 | } |
|
918 | | |
919 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
920 | 261 | Arena&) const override { |
921 | 261 | AggregateFunctionPercentile::data(place).merge(AggregateFunctionPercentile::data(rhs)); |
922 | 261 | } _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 920 | 8 | Arena&) const override { | 921 | 8 | AggregateFunctionPercentile::data(place).merge(AggregateFunctionPercentile::data(rhs)); | 922 | 8 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE5mergeEPcPKcRNS_5ArenaE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 920 | 223 | Arena&) const override { | 921 | 223 | AggregateFunctionPercentile::data(place).merge(AggregateFunctionPercentile::data(rhs)); | 922 | 223 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE5mergeEPcPKcRNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE5mergeEPcPKcRNS_5ArenaE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 920 | 30 | Arena&) const override { | 921 | 30 | AggregateFunctionPercentile::data(place).merge(AggregateFunctionPercentile::data(rhs)); | 922 | 30 | } |
|
923 | | |
924 | 254 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
925 | 254 | AggregateFunctionPercentile::data(place).write(buf); |
926 | 254 | } _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 924 | 8 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 925 | 8 | AggregateFunctionPercentile::data(place).write(buf); | 926 | 8 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE9serializeEPKcRNS_14BufferWritableE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 924 | 232 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 925 | 232 | AggregateFunctionPercentile::data(place).write(buf); | 926 | 232 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE9serializeEPKcRNS_14BufferWritableE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE9serializeEPKcRNS_14BufferWritableE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 924 | 14 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 925 | 14 | AggregateFunctionPercentile::data(place).write(buf); | 926 | 14 | } |
|
927 | | |
928 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
929 | 249 | Arena&) const override { |
930 | 249 | AggregateFunctionPercentile::data(place).read(buf); |
931 | 249 | } _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE3EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 929 | 8 | Arena&) const override { | 930 | 8 | AggregateFunctionPercentile::data(place).read(buf); | 931 | 8 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE4EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE5EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE6EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 929 | 223 | Arena&) const override { | 930 | 223 | AggregateFunctionPercentile::data(place).read(buf); | 931 | 223 | } |
Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE7EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Unexecuted instantiation: _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE8EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 929 | 18 | Arena&) const override { | 930 | 18 | AggregateFunctionPercentile::data(place).read(buf); | 931 | 18 | } |
|
932 | | |
933 | 52 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
934 | 52 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
935 | 52 | col.insert_value(AggregateFunctionPercentile::data(place).get()); |
936 | 52 | } 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 _ZNK5doris27AggregateFunctionPercentileILNS_13PrimitiveTypeE9EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 933 | 28 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 934 | 28 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); | 935 | 28 | col.insert_value(AggregateFunctionPercentile::data(place).get()); | 936 | 28 | } |
|
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 | 496 | AggregateFunctionPercentileArray(const DataTypes& argument_types_) : Base(argument_types_) {}_ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 949 | 116 | AggregateFunctionPercentileArray(const DataTypes& argument_types_) : Base(argument_types_) {} |
Unexecuted instantiation: _ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE4EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE _ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE5EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 949 | 376 | 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 _ZN5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 949 | 3 | AggregateFunctionPercentileArray(const DataTypes& argument_types_) : Base(argument_types_) {} |
|
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 | 120 | DataTypePtr get_return_type() const override { |
954 | 120 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); |
955 | 120 | } _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE15get_return_typeEv Line | Count | Source | 953 | 44 | DataTypePtr get_return_type() const override { | 954 | 44 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 955 | 44 | } |
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 _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE15get_return_typeEv Line | Count | Source | 953 | 76 | DataTypePtr get_return_type() const override { | 954 | 76 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 955 | 76 | } |
|
956 | | |
957 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
958 | 237 | Arena&) const override { |
959 | 237 | const auto& sources = |
960 | 237 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
961 | 237 | const auto& quantile_array = |
962 | 237 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
963 | 237 | const auto& offset_column_data = quantile_array.get_offsets(); |
964 | 237 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
965 | 237 | quantile_array.get_data()) |
966 | 237 | .get_null_map_data(); |
967 | 237 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
968 | 237 | quantile_array.get_data()) |
969 | 237 | .get_nested_column(); |
970 | 237 | const auto& nested_column_data = |
971 | 237 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); |
972 | | |
973 | 237 | AggregateFunctionPercentileArray::data(place).add( |
974 | 237 | sources.get_element(row_num), nested_column_data.get_data(), null_maps, |
975 | 237 | offset_column_data.data()[row_num] - offset_column_data[(ssize_t)row_num - 1]); |
976 | 237 | } _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 958 | 24 | Arena&) const override { | 959 | 24 | const auto& sources = | 960 | 24 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 961 | 24 | const auto& quantile_array = | 962 | 24 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 963 | 24 | const auto& offset_column_data = quantile_array.get_offsets(); | 964 | 24 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 965 | 24 | quantile_array.get_data()) | 966 | 24 | .get_null_map_data(); | 967 | 24 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 968 | 24 | quantile_array.get_data()) | 969 | 24 | .get_nested_column(); | 970 | 24 | const auto& nested_column_data = | 971 | 24 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 972 | | | 973 | 24 | AggregateFunctionPercentileArray::data(place).add( | 974 | 24 | sources.get_element(row_num), nested_column_data.get_data(), null_maps, | 975 | 24 | offset_column_data.data()[row_num] - offset_column_data[(ssize_t)row_num - 1]); | 976 | 24 | } |
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 _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE3addEPcPPKNS_7IColumnElRNS_5ArenaE Line | Count | Source | 958 | 113 | Arena&) const override { | 959 | 113 | const auto& sources = | 960 | 113 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 961 | 113 | const auto& quantile_array = | 962 | 113 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 963 | 113 | const auto& offset_column_data = quantile_array.get_offsets(); | 964 | 113 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 965 | 113 | quantile_array.get_data()) | 966 | 113 | .get_null_map_data(); | 967 | 113 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 968 | 113 | quantile_array.get_data()) | 969 | 113 | .get_nested_column(); | 970 | 113 | const auto& nested_column_data = | 971 | 113 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 972 | | | 973 | 113 | AggregateFunctionPercentileArray::data(place).add( | 974 | 113 | sources.get_element(row_num), nested_column_data.get_data(), null_maps, | 975 | 113 | offset_column_data.data()[row_num] - offset_column_data[(ssize_t)row_num - 1]); | 976 | 113 | } |
|
977 | | |
978 | 33 | void check_input_columns_type(const IColumn** columns) const override { |
979 | 33 | this->template check_argument_column_type<ColVecType>(columns[0]); |
980 | 33 | check_percentile_array_column_type(*this, *columns[1], 1); |
981 | 33 | } _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 978 | 24 | void check_input_columns_type(const IColumn** columns) const override { | 979 | 24 | this->template check_argument_column_type<ColVecType>(columns[0]); | 980 | 24 | check_percentile_array_column_type(*this, *columns[1], 1); | 981 | 24 | } |
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 | 31 | void reset(AggregateDataPtr __restrict place) const override { |
984 | 31 | AggregateFunctionPercentileArray::data(place).reset(); |
985 | 31 | } 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 _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE5resetEPc Line | Count | Source | 983 | 5 | void reset(AggregateDataPtr __restrict place) const override { | 984 | 5 | AggregateFunctionPercentileArray::data(place).reset(); | 985 | 5 | } |
|
986 | | |
987 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
988 | 226 | Arena&) const override { |
989 | 226 | AggregateFunctionPercentileArray::data(place).merge( |
990 | 226 | AggregateFunctionPercentileArray::data(rhs)); |
991 | 226 | } _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 988 | 30 | Arena&) const override { | 989 | 30 | AggregateFunctionPercentileArray::data(place).merge( | 990 | 30 | AggregateFunctionPercentileArray::data(rhs)); | 991 | 30 | } |
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 _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 988 | 75 | Arena&) const override { | 989 | 75 | AggregateFunctionPercentileArray::data(place).merge( | 990 | 75 | AggregateFunctionPercentileArray::data(rhs)); | 991 | 75 | } |
|
992 | | |
993 | 224 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
994 | 224 | AggregateFunctionPercentileArray::data(place).write(buf); |
995 | 224 | } _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 993 | 30 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 994 | 30 | AggregateFunctionPercentileArray::data(place).write(buf); | 995 | 30 | } |
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 _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 993 | 34 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 994 | 34 | AggregateFunctionPercentileArray::data(place).write(buf); | 995 | 34 | } |
|
996 | | |
997 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
998 | 193 | Arena&) const override { |
999 | 193 | AggregateFunctionPercentileArray::data(place).read(buf); |
1000 | 193 | } _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 998 | 30 | Arena&) const override { | 999 | 30 | AggregateFunctionPercentileArray::data(place).read(buf); | 1000 | 30 | } |
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 _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 998 | 42 | Arena&) const override { | 999 | 42 | AggregateFunctionPercentileArray::data(place).read(buf); | 1000 | 42 | } |
|
1001 | | |
1002 | 80 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
1003 | 80 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); |
1004 | 80 | auto& to_nested_col = to_arr.get_data(); |
1005 | 80 | if (is_column_nullable(to_nested_col)) { |
1006 | 80 | auto col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); |
1007 | 80 | AggregateFunctionPercentileArray::data(place).insert_result_into( |
1008 | 80 | col_null->get_nested_column()); |
1009 | 80 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); |
1010 | 80 | } else { |
1011 | 0 | AggregateFunctionPercentileArray::data(place).insert_result_into(to_nested_col); |
1012 | 0 | } |
1013 | 80 | to_arr.get_offsets().push_back(to_nested_col.size()); |
1014 | 80 | } _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE3EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1002 | 4 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1003 | 4 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 1004 | 4 | auto& to_nested_col = to_arr.get_data(); | 1005 | 4 | if (is_column_nullable(to_nested_col)) { | 1006 | 4 | auto col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); | 1007 | 4 | AggregateFunctionPercentileArray::data(place).insert_result_into( | 1008 | 4 | col_null->get_nested_column()); | 1009 | 4 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); | 1010 | 4 | } else { | 1011 | 0 | AggregateFunctionPercentileArray::data(place).insert_result_into(to_nested_col); | 1012 | 0 | } | 1013 | 4 | to_arr.get_offsets().push_back(to_nested_col.size()); | 1014 | 4 | } |
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 _ZNK5doris32AggregateFunctionPercentileArrayILNS_13PrimitiveTypeE9EE18insert_result_intoEPKcRNS_7IColumnE Line | Count | Source | 1002 | 76 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1003 | 76 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 1004 | 76 | auto& to_nested_col = to_arr.get_data(); | 1005 | 76 | if (is_column_nullable(to_nested_col)) { | 1006 | 76 | auto col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); | 1007 | 76 | AggregateFunctionPercentileArray::data(place).insert_result_into( | 1008 | 76 | col_null->get_nested_column()); | 1009 | 76 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); | 1010 | 76 | } else { | 1011 | 0 | AggregateFunctionPercentileArray::data(place).insert_result_into(to_nested_col); | 1012 | 0 | } | 1013 | 76 | to_arr.get_offsets().push_back(to_nested_col.size()); | 1014 | 76 | } |
|
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 | 135 | 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 | 39 | 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 | 26 | AggregateFunctionPercentileV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
|
1028 | | |
1029 | 119 | 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 | 102 | 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 | 1.37k | 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 | 484 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE5EE15get_return_typeEv Line | Count | Source | 1031 | 204 | DataTypePtr get_return_type() const override { return std::make_shared<DataTypeFloat64>(); } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE15get_return_typeEv Line | Count | Source | 1031 | 209 | 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 | 370 | 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 | 1.23k | Arena&) const override { |
1035 | 1.23k | const auto& sources = |
1036 | 1.23k | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
1037 | 1.23k | const auto& quantile = |
1038 | 1.23k | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
1039 | 1.23k | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, |
1040 | 1.23k | quantile.get_data()[0]); |
1041 | 1.23k | } _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 | 191 | Arena&) const override { | 1035 | 191 | const auto& sources = | 1036 | 191 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1037 | 191 | const auto& quantile = | 1038 | 191 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1039 | 191 | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, | 1040 | 191 | quantile.get_data()[0]); | 1041 | 191 | } |
_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 | 433 | Arena&) const override { | 1035 | 433 | const auto& sources = | 1036 | 433 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1037 | 433 | const auto& quantile = | 1038 | 433 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1039 | 433 | AggregateFunctionPercentileV2::data(place).add_single_range(&sources.get_data()[row_num], 1, | 1040 | 433 | quantile.get_data()[0]); | 1041 | 433 | } |
|
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 | 394 | void check_input_columns_type(const IColumn** columns) const override { |
1067 | 394 | this->template check_argument_column_type<ColVecType>(columns[0]); |
1068 | 394 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); |
1069 | 394 | } _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 | 76 | void check_input_columns_type(const IColumn** columns) const override { | 1067 | 76 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1068 | 76 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 1069 | 76 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1066 | 65 | void check_input_columns_type(const IColumn** columns) const override { | 1067 | 65 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1068 | 65 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 1069 | 65 | } |
_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 | 32 | void check_input_columns_type(const IColumn** columns) const override { | 1067 | 32 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1068 | 32 | this->template check_argument_column_type<ColumnFloat64>(columns[1]); | 1069 | 32 | } |
|
1070 | | |
1071 | 125 | void reset(AggregateDataPtr __restrict place) const override { |
1072 | 125 | AggregateFunctionPercentileV2::data(place).reset(); |
1073 | 125 | } Unexecuted instantiation: _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE3EE5resetEPc _ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE4EE5resetEPc Line | Count | Source | 1071 | 105 | void reset(AggregateDataPtr __restrict place) const override { | 1072 | 105 | AggregateFunctionPercentileV2::data(place).reset(); | 1073 | 105 | } |
_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 | 11 | void reset(AggregateDataPtr __restrict place) const override { | 1072 | 11 | AggregateFunctionPercentileV2::data(place).reset(); | 1073 | 11 | } |
|
1074 | | |
1075 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
1076 | 313 | Arena&) const override { |
1077 | 313 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); |
1078 | 313 | } _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 | 39 | Arena&) const override { | 1077 | 39 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); | 1078 | 39 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1076 | 87 | Arena&) const override { | 1077 | 87 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); | 1078 | 87 | } |
_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 | 178 | Arena&) const override { | 1077 | 178 | AggregateFunctionPercentileV2::data(place).merge(AggregateFunctionPercentileV2::data(rhs)); | 1078 | 178 | } |
|
1079 | | |
1080 | 216 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
1081 | 216 | AggregateFunctionPercentileV2::data(place).write(buf); |
1082 | 216 | } _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 | 39 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1081 | 39 | AggregateFunctionPercentileV2::data(place).write(buf); | 1082 | 39 | } |
_ZNK5doris29AggregateFunctionPercentileV2ILNS_13PrimitiveTypeE6EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1080 | 87 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1081 | 87 | AggregateFunctionPercentileV2::data(place).write(buf); | 1082 | 87 | } |
_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 | 81 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1081 | 81 | AggregateFunctionPercentileV2::data(place).write(buf); | 1082 | 81 | } |
|
1083 | | |
1084 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
1085 | 220 | Arena&) const override { |
1086 | 220 | AggregateFunctionPercentileV2::data(place).read(buf); |
1087 | 220 | } _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 | 87 | Arena&) const override { | 1086 | 87 | AggregateFunctionPercentileV2::data(place).read(buf); | 1087 | 87 | } |
_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 | 85 | Arena&) const override { | 1086 | 85 | AggregateFunctionPercentileV2::data(place).read(buf); | 1087 | 85 | } |
|
1088 | | |
1089 | 631 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
1090 | 631 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); |
1091 | 631 | col.insert_value(AggregateFunctionPercentileV2::data(place).get()); |
1092 | 631 | } _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 | 291 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1090 | 291 | auto& col = assert_cast<ColumnFloat64&, TypeCheckOnRelease::DISABLE>(to); | 1091 | 291 | col.insert_value(AggregateFunctionPercentileV2::data(place).get()); | 1092 | 291 | } |
|
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 | 109 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {}_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 5 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 7 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 51 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 14 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 5 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 3 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
_ZN5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EEC2ERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaIS7_EE Line | Count | Source | 1105 | 24 | AggregateFunctionPercentileArrayV2(const DataTypes& argument_types_) : Base(argument_types_) {} |
|
1106 | | |
1107 | 11 | 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 | 10 | String get_name() const override { return "percentile_array_v2"; } |
|
1108 | | |
1109 | 942 | DataTypePtr get_return_type() const override { |
1110 | 942 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); |
1111 | 942 | } _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE15get_return_typeEv Line | Count | Source | 1109 | 35 | DataTypePtr get_return_type() const override { | 1110 | 35 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 35 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE15get_return_typeEv Line | Count | Source | 1109 | 41 | DataTypePtr get_return_type() const override { | 1110 | 41 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 41 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE15get_return_typeEv Line | Count | Source | 1109 | 462 | DataTypePtr get_return_type() const override { | 1110 | 462 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 462 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE15get_return_typeEv Line | Count | Source | 1109 | 50 | DataTypePtr get_return_type() const override { | 1110 | 50 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 50 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE15get_return_typeEv Line | Count | Source | 1109 | 35 | DataTypePtr get_return_type() const override { | 1110 | 35 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 35 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE15get_return_typeEv Line | Count | Source | 1109 | 11 | DataTypePtr get_return_type() const override { | 1110 | 11 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 11 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE15get_return_typeEv Line | Count | Source | 1109 | 308 | DataTypePtr get_return_type() const override { | 1110 | 308 | return std::make_shared<DataTypeArray>(make_nullable(std::make_shared<DataTypeFloat64>())); | 1111 | 308 | } |
|
1112 | | |
1113 | | void add(AggregateDataPtr __restrict place, const IColumn** columns, ssize_t row_num, |
1114 | 929 | Arena&) const override { |
1115 | 929 | const auto& sources = |
1116 | 929 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); |
1117 | 929 | const auto& quantile_array = |
1118 | 929 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); |
1119 | 929 | const auto& offset_column_data = quantile_array.get_offsets(); |
1120 | 929 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
1121 | 929 | quantile_array.get_data()) |
1122 | 929 | .get_null_map_data(); |
1123 | 929 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( |
1124 | 929 | quantile_array.get_data()) |
1125 | 929 | .get_nested_column(); |
1126 | 929 | const auto& nested_column_data = |
1127 | 929 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); |
1128 | 929 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; |
1129 | 929 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( |
1130 | 929 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, |
1131 | 929 | cast_set<int64_t>(offset_column_data[row_num] - start)); |
1132 | 929 | } _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 | 517 | Arena&) const override { | 1115 | 517 | const auto& sources = | 1116 | 517 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1117 | 517 | const auto& quantile_array = | 1118 | 517 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1119 | 517 | const auto& offset_column_data = quantile_array.get_offsets(); | 1120 | 517 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1121 | 517 | quantile_array.get_data()) | 1122 | 517 | .get_null_map_data(); | 1123 | 517 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1124 | 517 | quantile_array.get_data()) | 1125 | 517 | .get_nested_column(); | 1126 | 517 | const auto& nested_column_data = | 1127 | 517 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 1128 | 517 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; | 1129 | 517 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( | 1130 | 517 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, | 1131 | 517 | cast_set<int64_t>(offset_column_data[row_num] - start)); | 1132 | 517 | } |
_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 | 316 | Arena&) const override { | 1115 | 316 | const auto& sources = | 1116 | 316 | assert_cast<const ColVecType&, TypeCheckOnRelease::DISABLE>(*columns[0]); | 1117 | 316 | const auto& quantile_array = | 1118 | 316 | assert_cast<const ColumnArray&, TypeCheckOnRelease::DISABLE>(*columns[1]); | 1119 | 316 | const auto& offset_column_data = quantile_array.get_offsets(); | 1120 | 316 | const auto& null_maps = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1121 | 316 | quantile_array.get_data()) | 1122 | 316 | .get_null_map_data(); | 1123 | 316 | const auto& nested_column = assert_cast<const ColumnNullable&, TypeCheckOnRelease::DISABLE>( | 1124 | 316 | quantile_array.get_data()) | 1125 | 316 | .get_nested_column(); | 1126 | 316 | const auto& nested_column_data = | 1127 | 316 | assert_cast<const ColumnFloat64&, TypeCheckOnRelease::DISABLE>(nested_column); | 1128 | 316 | size_t start = row_num == 0 ? 0 : offset_column_data[row_num - 1]; | 1129 | 316 | AggregateFunctionPercentileArrayV2::data(place).add_many_range( | 1130 | 316 | &sources.get_data()[row_num], 1, nested_column_data.get_data(), null_maps, start, | 1131 | 316 | cast_set<int64_t>(offset_column_data[row_num] - start)); | 1132 | 316 | } |
|
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 | 256 | void check_input_columns_type(const IColumn** columns) const override { |
1179 | 256 | this->template check_argument_column_type<ColVecType>(columns[0]); |
1180 | 256 | check_percentile_array_column_type(*this, *columns[1], 1); |
1181 | 256 | } _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 8 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 8 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 8 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 8 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 13 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 13 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 13 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 13 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 177 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 177 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 177 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 177 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 12 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 12 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 12 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 12 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE24check_input_columns_typeEPPKNS_7IColumnE Line | Count | Source | 1178 | 8 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 8 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 8 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 8 | } |
_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 | 36 | void check_input_columns_type(const IColumn** columns) const override { | 1179 | 36 | this->template check_argument_column_type<ColVecType>(columns[0]); | 1180 | 36 | check_percentile_array_column_type(*this, *columns[1], 1); | 1181 | 36 | } |
|
1182 | | |
1183 | 10 | void reset(AggregateDataPtr __restrict place) const override { |
1184 | 10 | AggregateFunctionPercentileArrayV2::data(place).reset(); |
1185 | 10 | } 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 | 10 | void reset(AggregateDataPtr __restrict place) const override { | 1184 | 10 | AggregateFunctionPercentileArrayV2::data(place).reset(); | 1185 | 10 | } |
|
1186 | | |
1187 | | void merge(AggregateDataPtr __restrict place, ConstAggregateDataPtr rhs, |
1188 | 348 | Arena&) const override { |
1189 | 348 | AggregateFunctionPercentileArrayV2::data(place).merge( |
1190 | 348 | AggregateFunctionPercentileArrayV2::data(rhs)); |
1191 | 348 | } _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1188 | 2 | Arena&) const override { | 1189 | 2 | AggregateFunctionPercentileArrayV2::data(place).merge( | 1190 | 2 | AggregateFunctionPercentileArrayV2::data(rhs)); | 1191 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1188 | 4 | Arena&) const override { | 1189 | 4 | AggregateFunctionPercentileArrayV2::data(place).merge( | 1190 | 4 | AggregateFunctionPercentileArrayV2::data(rhs)); | 1191 | 4 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1188 | 164 | Arena&) const override { | 1189 | 164 | AggregateFunctionPercentileArrayV2::data(place).merge( | 1190 | 164 | AggregateFunctionPercentileArrayV2::data(rhs)); | 1191 | 164 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1188 | 3 | Arena&) const override { | 1189 | 3 | AggregateFunctionPercentileArrayV2::data(place).merge( | 1190 | 3 | AggregateFunctionPercentileArrayV2::data(rhs)); | 1191 | 3 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1188 | 2 | Arena&) const override { | 1189 | 2 | AggregateFunctionPercentileArrayV2::data(place).merge( | 1190 | 2 | AggregateFunctionPercentileArrayV2::data(rhs)); | 1191 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1188 | 2 | Arena&) const override { | 1189 | 2 | AggregateFunctionPercentileArrayV2::data(place).merge( | 1190 | 2 | AggregateFunctionPercentileArrayV2::data(rhs)); | 1191 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE5mergeEPcPKcRNS_5ArenaE Line | Count | Source | 1188 | 171 | Arena&) const override { | 1189 | 171 | AggregateFunctionPercentileArrayV2::data(place).merge( | 1190 | 171 | AggregateFunctionPercentileArrayV2::data(rhs)); | 1191 | 171 | } |
|
1192 | | |
1193 | 280 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { |
1194 | 280 | AggregateFunctionPercentileArrayV2::data(place).write(buf); |
1195 | 280 | } _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1193 | 2 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1194 | 2 | AggregateFunctionPercentileArrayV2::data(place).write(buf); | 1195 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1193 | 4 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1194 | 4 | AggregateFunctionPercentileArrayV2::data(place).write(buf); | 1195 | 4 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1193 | 164 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1194 | 164 | AggregateFunctionPercentileArrayV2::data(place).write(buf); | 1195 | 164 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1193 | 3 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1194 | 3 | AggregateFunctionPercentileArrayV2::data(place).write(buf); | 1195 | 3 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1193 | 2 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1194 | 2 | AggregateFunctionPercentileArrayV2::data(place).write(buf); | 1195 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1193 | 2 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1194 | 2 | AggregateFunctionPercentileArrayV2::data(place).write(buf); | 1195 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE9serializeEPKcRNS_14BufferWritableE Line | Count | Source | 1193 | 103 | void serialize(ConstAggregateDataPtr __restrict place, BufferWritable& buf) const override { | 1194 | 103 | AggregateFunctionPercentileArrayV2::data(place).write(buf); | 1195 | 103 | } |
|
1196 | | |
1197 | | void deserialize(AggregateDataPtr __restrict place, BufferReadable& buf, |
1198 | 288 | Arena&) const override { |
1199 | 288 | AggregateFunctionPercentileArrayV2::data(place).read(buf); |
1200 | 288 | } _ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE3EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1198 | 2 | Arena&) const override { | 1199 | 2 | AggregateFunctionPercentileArrayV2::data(place).read(buf); | 1200 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE4EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1198 | 4 | Arena&) const override { | 1199 | 4 | AggregateFunctionPercentileArrayV2::data(place).read(buf); | 1200 | 4 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE5EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1198 | 164 | Arena&) const override { | 1199 | 164 | AggregateFunctionPercentileArrayV2::data(place).read(buf); | 1200 | 164 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE6EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1198 | 3 | Arena&) const override { | 1199 | 3 | AggregateFunctionPercentileArrayV2::data(place).read(buf); | 1200 | 3 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE7EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1198 | 2 | Arena&) const override { | 1199 | 2 | AggregateFunctionPercentileArrayV2::data(place).read(buf); | 1200 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE8EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1198 | 2 | Arena&) const override { | 1199 | 2 | AggregateFunctionPercentileArrayV2::data(place).read(buf); | 1200 | 2 | } |
_ZNK5doris34AggregateFunctionPercentileArrayV2ILNS_13PrimitiveTypeE9EE11deserializeEPcRNS_14BufferReadableERNS_5ArenaE Line | Count | Source | 1198 | 111 | Arena&) const override { | 1199 | 111 | AggregateFunctionPercentileArrayV2::data(place).read(buf); | 1200 | 111 | } |
|
1201 | | |
1202 | 428 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { |
1203 | 428 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); |
1204 | 428 | auto& to_nested_col = to_arr.get_data(); |
1205 | 428 | if (is_column_nullable(to_nested_col)) { |
1206 | 428 | auto* col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); |
1207 | 428 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into( |
1208 | 428 | col_null->get_nested_column()); |
1209 | 428 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); |
1210 | 428 | } else { |
1211 | 0 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into(to_nested_col); |
1212 | 0 | } |
1213 | 428 | to_arr.get_offsets().push_back(to_nested_col.size()); |
1214 | 428 | } _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 | 196 | void insert_result_into(ConstAggregateDataPtr __restrict place, IColumn& to) const override { | 1203 | 196 | auto& to_arr = assert_cast<ColumnArray&, TypeCheckOnRelease::DISABLE>(to); | 1204 | 196 | auto& to_nested_col = to_arr.get_data(); | 1205 | 196 | if (is_column_nullable(to_nested_col)) { | 1206 | 196 | auto* col_null = reinterpret_cast<ColumnNullable*>(&to_nested_col); | 1207 | 196 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into( | 1208 | 196 | col_null->get_nested_column()); | 1209 | 196 | col_null->get_null_map_data().resize_fill(col_null->get_nested_column().size(), 0); | 1210 | 196 | } else { | 1211 | 0 | AggregateFunctionPercentileArrayV2::data(place).insert_result_into(to_nested_col); | 1212 | 0 | } | 1213 | 196 | to_arr.get_offsets().push_back(to_nested_col.size()); | 1214 | 196 | } |
|
1215 | | }; |
1216 | | |
1217 | | } // namespace doris |