/root/doris/be/src/vec/functions/math.cpp
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 | | #include <cstddef> |
19 | | #include <cstdint> |
20 | | #include <cstring> |
21 | | |
22 | | // IWYU pragma: no_include <bits/std_abs.h> |
23 | | #include <dlfcn.h> |
24 | | |
25 | | #include <cmath> |
26 | | #include <string> |
27 | | #include <type_traits> |
28 | | |
29 | | #include "common/status.h" |
30 | | #include "runtime/define_primitive_type.h" |
31 | | #include "vec/aggregate_functions/aggregate_function.h" |
32 | | #include "vec/columns/column.h" |
33 | | #include "vec/columns/column_string.h" |
34 | | #include "vec/columns/column_vector.h" |
35 | | #include "vec/core/field.h" |
36 | | #include "vec/core/types.h" |
37 | | #include "vec/data_types/data_type_string.h" |
38 | | #include "vec/data_types/data_type_struct.h" |
39 | | #include "vec/data_types/number_traits.h" |
40 | | #include "vec/functions/function_const.h" |
41 | | #include "vec/functions/function_math_log.h" |
42 | | #include "vec/functions/function_math_unary.h" |
43 | | #include "vec/functions/function_math_unary_alway_nullable.h" |
44 | | #include "vec/functions/function_totype.h" |
45 | | #include "vec/functions/function_unary_arithmetic.h" |
46 | | #include "vec/functions/simple_function_factory.h" |
47 | | #include "vec/utils/stringop_substring.h" |
48 | | |
49 | | namespace doris::vectorized { |
50 | | |
51 | | struct AcosName { |
52 | | static constexpr auto name = "acos"; |
53 | | // https://dev.mysql.com/doc/refman/8.4/en/mathematical-functions.html#function_acos |
54 | 4 | static constexpr bool is_invalid_input(Float64 x) { return x < -1 || x > 1; } |
55 | | }; |
56 | | using FunctionAcos = |
57 | | FunctionMathUnaryAlwayNullable<UnaryFunctionPlainAlwayNullable<AcosName, std::acos>>; |
58 | | |
59 | | struct AcoshName { |
60 | | static constexpr auto name = "acosh"; |
61 | 10 | static constexpr bool is_invalid_input(Float64 x) { return x < 1; } |
62 | | }; |
63 | | using FunctionAcosh = |
64 | | FunctionMathUnaryAlwayNullable<UnaryFunctionPlainAlwayNullable<AcoshName, std::acosh>>; |
65 | | |
66 | | struct AsinName { |
67 | | static constexpr auto name = "asin"; |
68 | | // https://dev.mysql.com/doc/refman/8.4/en/mathematical-functions.html#function_asin |
69 | 4 | static constexpr bool is_invalid_input(Float64 x) { return x < -1 || x > 1; } |
70 | | }; |
71 | | using FunctionAsin = |
72 | | FunctionMathUnaryAlwayNullable<UnaryFunctionPlainAlwayNullable<AsinName, std::asin>>; |
73 | | |
74 | | struct AsinhName { |
75 | | static constexpr auto name = "asinh"; |
76 | | }; |
77 | | using FunctionAsinh = FunctionMathUnary<UnaryFunctionPlain<AsinhName, std::asinh>>; |
78 | | |
79 | | class FunctionAtan : public IFunction { |
80 | | public: |
81 | | static constexpr auto name = "atan"; |
82 | 3 | static FunctionPtr create() { return std::make_shared<FunctionAtan>(); } |
83 | | |
84 | 0 | String get_name() const override { return name; } |
85 | 2 | bool is_variadic() const override { return true; } |
86 | 0 | size_t get_number_of_arguments() const override { return 0; } |
87 | | |
88 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
89 | 1 | return std::make_shared<DataTypeFloat64>(); |
90 | 1 | } |
91 | | |
92 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
93 | 1 | uint32_t result, size_t input_rows_count) const override { |
94 | 1 | if (arguments.size() == 1) { |
95 | 1 | return execute_unary(block, arguments, result, input_rows_count); |
96 | 1 | } else if (arguments.size() == 2) { |
97 | 0 | return execute_binary(block, arguments, result, input_rows_count); |
98 | 0 | } else { |
99 | 0 | return Status::InvalidArgument("atan function expects 1 or 2 arguments, but got {}", |
100 | 0 | arguments.size()); |
101 | 0 | } |
102 | 1 | } |
103 | | |
104 | | private: |
105 | | Status execute_unary(Block& block, const ColumnNumbers& arguments, uint32_t result, |
106 | 1 | size_t input_rows_count) const { |
107 | 1 | auto res_col = ColumnFloat64::create(input_rows_count); |
108 | 1 | auto& res_data = res_col->get_data(); |
109 | | |
110 | 1 | const auto& col_data = |
111 | 1 | assert_cast<const ColumnFloat64*>(block.get_by_position(arguments[0]).column.get()) |
112 | 1 | ->get_data(); |
113 | 5 | for (size_t i = 0; i < input_rows_count; ++i) { |
114 | 4 | res_data[i] = std::atan(col_data[i]); |
115 | 4 | } |
116 | | |
117 | 1 | block.replace_by_position(result, std::move(res_col)); |
118 | 1 | return Status::OK(); |
119 | 1 | } |
120 | | |
121 | | Status execute_binary(Block& block, const ColumnNumbers& arguments, uint32_t result, |
122 | 0 | size_t input_rows_count) const { |
123 | 0 | auto [col_y, is_const_y] = unpack_if_const(block.get_by_position(arguments[0]).column); |
124 | 0 | auto [col_x, is_const_x] = unpack_if_const(block.get_by_position(arguments[1]).column); |
125 | |
|
126 | 0 | auto result_column = ColumnFloat64::create(input_rows_count); |
127 | 0 | auto& result_data = result_column->get_data(); |
128 | |
|
129 | 0 | if (is_const_y) { |
130 | 0 | auto y_val = assert_cast<const ColumnFloat64*>(col_y.get())->get_element(0); |
131 | |
|
132 | 0 | const auto* x_col = assert_cast<const ColumnFloat64*>(col_x.get()); |
133 | 0 | const auto& x_data = x_col->get_data(); |
134 | 0 | for (size_t i = 0; i < input_rows_count; ++i) { |
135 | 0 | result_data[i] = std::atan2(y_val, x_data[i]); |
136 | 0 | } |
137 | 0 | } else if (is_const_x) { |
138 | 0 | auto x_val = assert_cast<const ColumnFloat64*>(col_x.get())->get_element(0); |
139 | |
|
140 | 0 | const auto* y_col = assert_cast<const ColumnFloat64*>(col_y.get()); |
141 | 0 | const auto& y_data = y_col->get_data(); |
142 | 0 | for (size_t i = 0; i < input_rows_count; ++i) { |
143 | 0 | result_data[i] = std::atan2(y_data[i], x_val); |
144 | 0 | } |
145 | 0 | } else { |
146 | 0 | const auto* y_col = assert_cast<const ColumnFloat64*>(col_y.get()); |
147 | 0 | const auto* x_col = assert_cast<const ColumnFloat64*>(col_x.get()); |
148 | 0 | const auto& y_data = y_col->get_data(); |
149 | 0 | const auto& x_data = x_col->get_data(); |
150 | 0 | for (size_t i = 0; i < input_rows_count; ++i) { |
151 | 0 | result_data[i] = std::atan2(y_data[i], x_data[i]); |
152 | 0 | } |
153 | 0 | } |
154 | |
|
155 | 0 | block.replace_by_position(result, std::move(result_column)); |
156 | 0 | return Status::OK(); |
157 | 0 | } |
158 | | }; |
159 | | |
160 | | struct AtanhName { |
161 | | static constexpr auto name = "atanh"; |
162 | 10 | static constexpr bool is_invalid_input(Float64 x) { return x <= -1 || x >= 1; } |
163 | | }; |
164 | | using FunctionAtanh = |
165 | | FunctionMathUnaryAlwayNullable<UnaryFunctionPlainAlwayNullable<AtanhName, std::atanh>>; |
166 | | |
167 | | struct CosName { |
168 | | static constexpr auto name = "cos"; |
169 | | }; |
170 | | using FunctionCos = FunctionMathUnary<UnaryFunctionPlain<CosName, std::cos>>; |
171 | | |
172 | | struct CoshName { |
173 | | static constexpr auto name = "cosh"; |
174 | | }; |
175 | | using FunctionCosh = FunctionMathUnary<UnaryFunctionPlain<CoshName, std::cosh>>; |
176 | | |
177 | | struct EImpl { |
178 | | static constexpr auto name = "e"; |
179 | | static constexpr double value = 2.7182818284590452353602874713526624977572470; |
180 | | }; |
181 | | using FunctionE = FunctionMathConstFloat64<EImpl>; |
182 | | |
183 | | struct PiImpl { |
184 | | static constexpr auto name = "pi"; |
185 | | static constexpr double value = 3.1415926535897932384626433832795028841971693; |
186 | | }; |
187 | | using FunctionPi = FunctionMathConstFloat64<PiImpl>; |
188 | | |
189 | | struct ExpName { |
190 | | static constexpr auto name = "exp"; |
191 | | }; |
192 | | using FunctionExp = FunctionMathUnary<UnaryFunctionPlain<ExpName, std::exp>>; |
193 | | |
194 | | template <typename A> |
195 | | struct SignImpl { |
196 | | static constexpr PrimitiveType ResultType = TYPE_TINYINT; |
197 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
198 | 3 | static inline UInt8 apply(A a) { |
199 | 3 | if constexpr (IsDecimalNumber<A> || std::is_floating_point_v<A>) { |
200 | 3 | return static_cast<UInt8>(a < A(0) ? -1 : a == A(0) ? 0 : 1); |
201 | | } else if constexpr (IsSignedV<A>) { |
202 | | return static_cast<UInt8>(a < 0 ? -1 : a == 0 ? 0 : 1); |
203 | | } else { |
204 | | static_assert(std::is_same_v<A, void>, "Unsupported type in SignImpl"); |
205 | | } |
206 | 3 | } |
207 | | }; |
208 | | |
209 | | struct NameSign { |
210 | | static constexpr auto name = "sign"; |
211 | | }; |
212 | | using FunctionSign = FunctionUnaryArithmetic<SignImpl<double>, NameSign, TYPE_DOUBLE>; |
213 | | |
214 | | template <typename A> |
215 | | struct AbsImpl { |
216 | | static constexpr PrimitiveType ResultType = NumberTraits::ResultOfAbs<A>::Type; |
217 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
218 | 12 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { |
219 | 12 | if constexpr (IsDecimalNumber<A>) { |
220 | 0 | return a < A(0) ? A(-a) : a; |
221 | 7 | } else if constexpr (IsIntegralV<A>) { |
222 | 7 | return a < A(0) ? static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( |
223 | 3 | ~a) + |
224 | 3 | 1 |
225 | 7 | : a; |
226 | 7 | } else if constexpr (std::is_floating_point_v<A>) { |
227 | 5 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( |
228 | 5 | std::abs(a)); |
229 | | } else { |
230 | | static_assert(std::is_same_v<A, void>, "Unsupported type in AbsImpl"); |
231 | | } |
232 | 12 | } Unexecuted instantiation: _ZN5doris10vectorized7AbsImplIaE5applyEa Unexecuted instantiation: _ZN5doris10vectorized7AbsImplIsE5applyEs _ZN5doris10vectorized7AbsImplIiE5applyEi Line | Count | Source | 218 | 7 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { | 219 | | if constexpr (IsDecimalNumber<A>) { | 220 | | return a < A(0) ? A(-a) : a; | 221 | 7 | } else if constexpr (IsIntegralV<A>) { | 222 | 7 | return a < A(0) ? static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( | 223 | 3 | ~a) + | 224 | 3 | 1 | 225 | 7 | : a; | 226 | | } else if constexpr (std::is_floating_point_v<A>) { | 227 | | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( | 228 | | std::abs(a)); | 229 | | } else { | 230 | | static_assert(std::is_same_v<A, void>, "Unsupported type in AbsImpl"); | 231 | | } | 232 | 7 | } |
Unexecuted instantiation: _ZN5doris10vectorized7AbsImplIlE5applyEl Unexecuted instantiation: _ZN5doris10vectorized7AbsImplInE5applyEn Unexecuted instantiation: _ZN5doris10vectorized7AbsImplIhE5applyEh Unexecuted instantiation: _ZN5doris10vectorized7AbsImplINS0_7DecimalIiEEE5applyES3_ Unexecuted instantiation: _ZN5doris10vectorized7AbsImplINS0_7DecimalIlEEE5applyES3_ Unexecuted instantiation: _ZN5doris10vectorized7AbsImplINS0_12Decimal128V3EE5applyES2_ Unexecuted instantiation: _ZN5doris10vectorized7AbsImplINS0_7DecimalInEEE5applyES3_ Unexecuted instantiation: _ZN5doris10vectorized7AbsImplINS0_7DecimalIN4wide7integerILm256EiEEEEE5applyES6_ Unexecuted instantiation: _ZN5doris10vectorized7AbsImplIfE5applyEf _ZN5doris10vectorized7AbsImplIdE5applyEd Line | Count | Source | 218 | 5 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { | 219 | | if constexpr (IsDecimalNumber<A>) { | 220 | | return a < A(0) ? A(-a) : a; | 221 | | } else if constexpr (IsIntegralV<A>) { | 222 | | return a < A(0) ? static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( | 223 | | ~a) + | 224 | | 1 | 225 | | : a; | 226 | 5 | } else if constexpr (std::is_floating_point_v<A>) { | 227 | 5 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( | 228 | 5 | std::abs(a)); | 229 | | } else { | 230 | | static_assert(std::is_same_v<A, void>, "Unsupported type in AbsImpl"); | 231 | | } | 232 | 5 | } |
|
233 | | }; |
234 | | |
235 | | struct NameAbs { |
236 | | static constexpr auto name = "abs"; |
237 | | }; |
238 | | |
239 | | template <typename A> |
240 | | struct ResultOfPosAndNegTive; |
241 | | |
242 | | template <> |
243 | | struct ResultOfPosAndNegTive<Int64> { |
244 | | static constexpr PrimitiveType ResultType = TYPE_BIGINT; |
245 | | }; |
246 | | template <> |
247 | | struct ResultOfPosAndNegTive<double> { |
248 | | static constexpr PrimitiveType ResultType = TYPE_DOUBLE; |
249 | | }; |
250 | | |
251 | | template <> |
252 | | struct ResultOfPosAndNegTive<Decimal32> { |
253 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL32; |
254 | | }; |
255 | | |
256 | | template <> |
257 | | struct ResultOfPosAndNegTive<Decimal64> { |
258 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL64; |
259 | | }; |
260 | | |
261 | | template <> |
262 | | struct ResultOfPosAndNegTive<Decimal128V2> { |
263 | | static constexpr PrimitiveType ResultType = TYPE_DECIMALV2; |
264 | | }; |
265 | | |
266 | | template <> |
267 | | struct ResultOfPosAndNegTive<Decimal128V3> { |
268 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL128I; |
269 | | }; |
270 | | |
271 | | template <> |
272 | | struct ResultOfPosAndNegTive<Decimal256> { |
273 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL256; |
274 | | }; |
275 | | |
276 | | template <typename A> |
277 | | struct ResultOfUnaryFunc; |
278 | | |
279 | | template <> |
280 | | struct ResultOfUnaryFunc<UInt8> { |
281 | | static constexpr PrimitiveType ResultType = TYPE_BOOLEAN; |
282 | | }; |
283 | | |
284 | | template <> |
285 | | struct ResultOfUnaryFunc<Int8> { |
286 | | static constexpr PrimitiveType ResultType = TYPE_TINYINT; |
287 | | }; |
288 | | |
289 | | template <> |
290 | | struct ResultOfUnaryFunc<Int16> { |
291 | | static constexpr PrimitiveType ResultType = TYPE_SMALLINT; |
292 | | }; |
293 | | |
294 | | template <> |
295 | | struct ResultOfUnaryFunc<Int32> { |
296 | | static constexpr PrimitiveType ResultType = TYPE_INT; |
297 | | }; |
298 | | |
299 | | template <> |
300 | | struct ResultOfUnaryFunc<Int64> { |
301 | | static constexpr PrimitiveType ResultType = TYPE_BIGINT; |
302 | | }; |
303 | | |
304 | | template <> |
305 | | struct ResultOfUnaryFunc<Int128> { |
306 | | static constexpr PrimitiveType ResultType = TYPE_LARGEINT; |
307 | | }; |
308 | | |
309 | | template <> |
310 | | struct ResultOfUnaryFunc<Decimal32> { |
311 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL32; |
312 | | }; |
313 | | |
314 | | template <> |
315 | | struct ResultOfUnaryFunc<Decimal64> { |
316 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL64; |
317 | | }; |
318 | | |
319 | | template <> |
320 | | struct ResultOfUnaryFunc<Decimal128V3> { |
321 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL128I; |
322 | | }; |
323 | | |
324 | | template <> |
325 | | struct ResultOfUnaryFunc<Decimal128V2> { |
326 | | static constexpr PrimitiveType ResultType = TYPE_DECIMALV2; |
327 | | }; |
328 | | |
329 | | template <> |
330 | | struct ResultOfUnaryFunc<Decimal256> { |
331 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL256; |
332 | | }; |
333 | | |
334 | | template <> |
335 | | struct ResultOfUnaryFunc<float> { |
336 | | static constexpr PrimitiveType ResultType = TYPE_FLOAT; |
337 | | }; |
338 | | |
339 | | template <> |
340 | | struct ResultOfUnaryFunc<double> { |
341 | | static constexpr PrimitiveType ResultType = TYPE_DOUBLE; |
342 | | }; |
343 | | |
344 | | using FunctionAbsUInt8 = FunctionUnaryArithmetic<AbsImpl<UInt8>, NameAbs, TYPE_BOOLEAN>; |
345 | | using FunctionAbsInt8 = FunctionUnaryArithmetic<AbsImpl<Int8>, NameAbs, TYPE_TINYINT>; |
346 | | using FunctionAbsInt16 = FunctionUnaryArithmetic<AbsImpl<Int16>, NameAbs, TYPE_SMALLINT>; |
347 | | using FunctionAbsInt32 = FunctionUnaryArithmetic<AbsImpl<Int32>, NameAbs, TYPE_INT>; |
348 | | using FunctionAbsInt64 = FunctionUnaryArithmetic<AbsImpl<Int64>, NameAbs, TYPE_BIGINT>; |
349 | | using FunctionAbsInt128 = FunctionUnaryArithmetic<AbsImpl<Int128>, NameAbs, TYPE_LARGEINT>; |
350 | | using FunctionAbsDecimal32 = FunctionUnaryArithmetic<AbsImpl<Decimal32>, NameAbs, TYPE_DECIMAL32>; |
351 | | using FunctionAbsDecimal64 = FunctionUnaryArithmetic<AbsImpl<Decimal64>, NameAbs, TYPE_DECIMAL64>; |
352 | | using FunctionAbsDecimalV3 = |
353 | | FunctionUnaryArithmetic<AbsImpl<Decimal128V3>, NameAbs, TYPE_DECIMAL128I>; |
354 | | using FunctionAbsDecimalV2 = |
355 | | FunctionUnaryArithmetic<AbsImpl<Decimal128V2>, NameAbs, TYPE_DECIMALV2>; |
356 | | using FunctionAbsDecimal256 = |
357 | | FunctionUnaryArithmetic<AbsImpl<Decimal256>, NameAbs, TYPE_DECIMAL256>; |
358 | | using FunctionAbsFloat = FunctionUnaryArithmetic<AbsImpl<float>, NameAbs, TYPE_FLOAT>; |
359 | | using FunctionAbsDouble = FunctionUnaryArithmetic<AbsImpl<double>, NameAbs, TYPE_DOUBLE>; |
360 | | |
361 | | template <typename A> |
362 | | struct NegativeImpl { |
363 | | static constexpr PrimitiveType ResultType = ResultOfPosAndNegTive<A>::ResultType; |
364 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
365 | | NO_SANITIZE_UNDEFINED static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType |
366 | 4 | apply(A a) { |
367 | 4 | return -a; |
368 | 4 | } _ZN5doris10vectorized12NegativeImplIdE5applyEd Line | Count | Source | 366 | 4 | apply(A a) { | 367 | 4 | return -a; | 368 | 4 | } |
Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplIlE5applyEl Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplINS0_7DecimalInEEE5applyES3_ Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplINS0_7DecimalIN4wide7integerILm256EiEEEEE5applyES6_ Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplINS0_12Decimal128V3EE5applyES2_ Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplINS0_7DecimalIiEEE5applyES3_ Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplINS0_7DecimalIlEEE5applyES3_ |
369 | | }; |
370 | | |
371 | | struct NameNegative { |
372 | | static constexpr auto name = "negative"; |
373 | | }; |
374 | | |
375 | | using FunctionNegativeDouble = |
376 | | FunctionUnaryArithmetic<NegativeImpl<double>, NameNegative, TYPE_DOUBLE>; |
377 | | using FunctionNegativeBigInt = |
378 | | FunctionUnaryArithmetic<NegativeImpl<Int64>, NameNegative, TYPE_BIGINT>; |
379 | | using FunctionNegativeDecimalV2 = |
380 | | FunctionUnaryArithmetic<NegativeImpl<Decimal128V2>, NameNegative, TYPE_DECIMALV2>; |
381 | | using FunctionNegativeDecimal256 = |
382 | | FunctionUnaryArithmetic<NegativeImpl<Decimal256>, NameNegative, TYPE_DECIMAL256>; |
383 | | using FunctionNegativeDecimalV3 = |
384 | | FunctionUnaryArithmetic<NegativeImpl<Decimal128V3>, NameNegative, TYPE_DECIMAL128I>; |
385 | | using FunctionNegativeDecimal32 = |
386 | | FunctionUnaryArithmetic<NegativeImpl<Decimal32>, NameNegative, TYPE_DECIMAL32>; |
387 | | using FunctionNegativeDecimal64 = |
388 | | FunctionUnaryArithmetic<NegativeImpl<Decimal64>, NameNegative, TYPE_DECIMAL64>; |
389 | | |
390 | | template <typename A> |
391 | | struct PositiveImpl { |
392 | | static constexpr PrimitiveType ResultType = ResultOfPosAndNegTive<A>::ResultType; |
393 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
394 | 8 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { |
395 | 8 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>(a); |
396 | 8 | } Unexecuted instantiation: _ZN5doris10vectorized12PositiveImplINS0_7DecimalIiEEE5applyES3_ _ZN5doris10vectorized12PositiveImplINS0_7DecimalIlEEE5applyES3_ Line | Count | Source | 394 | 4 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { | 395 | 4 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>(a); | 396 | 4 | } |
Unexecuted instantiation: _ZN5doris10vectorized12PositiveImplINS0_12Decimal128V3EE5applyES2_ Unexecuted instantiation: _ZN5doris10vectorized12PositiveImplINS0_7DecimalInEEE5applyES3_ Unexecuted instantiation: _ZN5doris10vectorized12PositiveImplINS0_7DecimalIN4wide7integerILm256EiEEEEE5applyES6_ _ZN5doris10vectorized12PositiveImplIdE5applyEd Line | Count | Source | 394 | 4 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { | 395 | 4 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>(a); | 396 | 4 | } |
Unexecuted instantiation: _ZN5doris10vectorized12PositiveImplIlE5applyEl |
397 | | }; |
398 | | |
399 | | struct NamePositive { |
400 | | static constexpr auto name = "positive"; |
401 | | }; |
402 | | |
403 | | using FunctionPositiveDouble = |
404 | | FunctionUnaryArithmetic<PositiveImpl<double>, NamePositive, TYPE_DOUBLE>; |
405 | | using FunctionPositiveBigInt = |
406 | | FunctionUnaryArithmetic<PositiveImpl<Int64>, NamePositive, TYPE_BIGINT>; |
407 | | using FunctionPositiveDecimalV2 = |
408 | | FunctionUnaryArithmetic<PositiveImpl<Decimal128V2>, NamePositive, TYPE_DECIMALV2>; |
409 | | using FunctionPositiveDecimal256 = |
410 | | FunctionUnaryArithmetic<PositiveImpl<Decimal256>, NamePositive, TYPE_DECIMAL256>; |
411 | | using FunctionPositiveDecimalV3 = |
412 | | FunctionUnaryArithmetic<PositiveImpl<Decimal128V3>, NamePositive, TYPE_DECIMAL128I>; |
413 | | using FunctionPositiveDecimal32 = |
414 | | FunctionUnaryArithmetic<PositiveImpl<Decimal32>, NamePositive, TYPE_DECIMAL32>; |
415 | | using FunctionPositiveDecimal64 = |
416 | | FunctionUnaryArithmetic<PositiveImpl<Decimal64>, NamePositive, TYPE_DECIMAL64>; |
417 | | |
418 | | struct SinName { |
419 | | static constexpr auto name = "sin"; |
420 | | }; |
421 | | using FunctionSin = FunctionMathUnary<UnaryFunctionPlain<SinName, std::sin>>; |
422 | | |
423 | | struct SinhName { |
424 | | static constexpr auto name = "sinh"; |
425 | | }; |
426 | | using FunctionSinh = FunctionMathUnary<UnaryFunctionPlain<SinhName, std::sinh>>; |
427 | | |
428 | | struct SqrtName { |
429 | | static constexpr auto name = "sqrt"; |
430 | | // https://dev.mysql.com/doc/refman/8.4/en/mathematical-functions.html#function_sqrt |
431 | 4 | static constexpr bool is_invalid_input(Float64 x) { return x < 0; } |
432 | | }; |
433 | | using FunctionSqrt = |
434 | | FunctionMathUnaryAlwayNullable<UnaryFunctionPlainAlwayNullable<SqrtName, std::sqrt>>; |
435 | | |
436 | | struct CbrtName { |
437 | | static constexpr auto name = "cbrt"; |
438 | | }; |
439 | | using FunctionCbrt = FunctionMathUnary<UnaryFunctionPlain<CbrtName, std::cbrt>>; |
440 | | |
441 | | struct TanName { |
442 | | static constexpr auto name = "tan"; |
443 | | }; |
444 | | using FunctionTan = FunctionMathUnary<UnaryFunctionPlain<TanName, std::tan>>; |
445 | | |
446 | | struct TanhName { |
447 | | static constexpr auto name = "tanh"; |
448 | | }; |
449 | | using FunctionTanh = FunctionMathUnary<UnaryFunctionPlain<TanhName, std::tanh>>; |
450 | | |
451 | | struct CotName { |
452 | | static constexpr auto name = "cot"; |
453 | | }; |
454 | 2 | double cot(double x) { |
455 | 2 | return 1.0 / std::tan(x); |
456 | 2 | } |
457 | | using FunctionCot = FunctionMathUnary<UnaryFunctionPlain<CotName, cot>>; |
458 | | |
459 | | struct SecName { |
460 | | static constexpr auto name = "sec"; |
461 | | }; |
462 | 2 | double sec(double x) { |
463 | 2 | return 1.0 / std::cos(x); |
464 | 2 | } |
465 | | using FunctionSec = FunctionMathUnary<UnaryFunctionPlain<SecName, sec>>; |
466 | | |
467 | | struct CscName { |
468 | | static constexpr auto name = "csc"; |
469 | | }; |
470 | 3 | double csc(double x) { |
471 | 3 | return 1.0 / std::sin(x); |
472 | 3 | } |
473 | | using FunctionCosec = FunctionMathUnary<UnaryFunctionPlain<CscName, csc>>; |
474 | | |
475 | | static const Int64 FACT_TABLE[] = {1LL, |
476 | | 1LL, |
477 | | 2LL, |
478 | | 6LL, |
479 | | 24LL, |
480 | | 120LL, |
481 | | 720LL, |
482 | | 5040LL, |
483 | | 40320LL, |
484 | | 362880LL, |
485 | | 3628800LL, |
486 | | 39916800LL, |
487 | | 479001600LL, |
488 | | 6227020800LL, |
489 | | 87178291200LL, |
490 | | 1307674368000LL, |
491 | | 20922789888000LL, |
492 | | 355687428096000LL, |
493 | | 6402373705728000LL, |
494 | | 121645100408832000LL, |
495 | | 2432902008176640000LL}; |
496 | | |
497 | | class FunctionFactorial : public IFunction { |
498 | | public: |
499 | | static constexpr auto name = "factorial"; |
500 | 16 | static FunctionPtr create() { return std::make_shared<FunctionFactorial>(); } |
501 | | |
502 | | private: |
503 | 1 | String get_name() const override { return name; } |
504 | 14 | size_t get_number_of_arguments() const override { return 1; } |
505 | | |
506 | 14 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
507 | 14 | return make_nullable(std::make_shared<DataTypeInt64>()); |
508 | 14 | } |
509 | | |
510 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
511 | 12 | uint32_t result, size_t input_rows_count) const override { |
512 | 12 | const auto* data_col = |
513 | 12 | check_and_get_column<ColumnInt64>(block.get_by_position(arguments[0]).column.get()); |
514 | 12 | if (!data_col) { |
515 | 0 | return Status::InternalError( |
516 | 0 | "Unexpected column '%s' for argument of function %s", |
517 | 0 | block.get_by_position(arguments[0]).column->get_name().c_str(), get_name()); |
518 | 0 | } |
519 | | |
520 | 12 | auto result_column = ColumnInt64::create(input_rows_count); |
521 | 12 | auto result_null_map = ColumnUInt8::create(input_rows_count, 0); |
522 | 12 | auto& result_data = result_column->get_data(); |
523 | 12 | auto& result_null_map_data = result_null_map->get_data(); |
524 | | |
525 | 12 | const auto& src_data = data_col->get_data(); |
526 | 30 | for (size_t i = 0; i < input_rows_count; ++i) { |
527 | 18 | Int64 n = src_data[i]; |
528 | 18 | if (n < 0 || n > 20) { |
529 | 6 | result_null_map_data[i] = 1; |
530 | 6 | result_data[i] = 0; |
531 | 12 | } else { |
532 | 12 | result_data[i] = FACT_TABLE[n]; |
533 | 12 | } |
534 | 18 | } |
535 | | |
536 | 12 | block.replace_by_position(result, ColumnNullable::create(std::move(result_column), |
537 | 12 | std::move(result_null_map))); |
538 | | |
539 | 12 | return Status::OK(); |
540 | 12 | } |
541 | | }; |
542 | | |
543 | | template <typename A> |
544 | | struct RadiansImpl { |
545 | | static constexpr PrimitiveType ResultType = TYPE_DOUBLE; |
546 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
547 | 4 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { |
548 | 4 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>(a / 180.0 * |
549 | 4 | PiImpl::value); |
550 | 4 | } |
551 | | }; |
552 | | |
553 | | struct NameRadians { |
554 | | static constexpr auto name = "radians"; |
555 | | }; |
556 | | |
557 | | using FunctionRadians = FunctionUnaryArithmetic<RadiansImpl<double>, NameRadians, TYPE_DOUBLE>; |
558 | | |
559 | | template <typename A> |
560 | | struct DegreesImpl { |
561 | | static constexpr PrimitiveType ResultType = TYPE_DOUBLE; |
562 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
563 | 4 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { |
564 | 4 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>(a * 180.0 / |
565 | 4 | PiImpl::value); |
566 | 4 | } |
567 | | }; |
568 | | |
569 | | struct NameDegrees { |
570 | | static constexpr auto name = "degrees"; |
571 | | }; |
572 | | |
573 | | using FunctionDegrees = FunctionUnaryArithmetic<DegreesImpl<double>, NameDegrees, TYPE_DOUBLE>; |
574 | | |
575 | | struct NameBin { |
576 | | static constexpr auto name = "bin"; |
577 | | }; |
578 | | struct BinImpl { |
579 | | using ReturnType = DataTypeString; |
580 | | static constexpr auto PrimitiveTypeImpl = PrimitiveType::TYPE_BIGINT; |
581 | | using Type = Int64; |
582 | | using ReturnColumnType = ColumnString; |
583 | | |
584 | 4 | static std::string bin_impl(Int64 value) { |
585 | 4 | auto n = static_cast<uint64_t>(value); |
586 | 4 | const size_t max_bits = sizeof(uint64_t) * 8; |
587 | 4 | char result[max_bits]; |
588 | 4 | uint32_t index = max_bits; |
589 | 7 | do { |
590 | 7 | result[--index] = '0' + (n & 1); |
591 | 7 | } while (n >>= 1); |
592 | 4 | return std::string(result + index, max_bits - index); |
593 | 4 | } |
594 | | |
595 | | static Status vector(const ColumnInt64::Container& data, ColumnString::Chars& res_data, |
596 | 1 | ColumnString::Offsets& res_offsets) { |
597 | 1 | res_offsets.resize(data.size()); |
598 | 1 | size_t input_size = res_offsets.size(); |
599 | | |
600 | 5 | for (size_t i = 0; i < input_size; ++i) { |
601 | 4 | StringOP::push_value_string(bin_impl(data[i]), i, res_data, res_offsets); |
602 | 4 | } |
603 | 1 | return Status::OK(); |
604 | 1 | } |
605 | | }; |
606 | | |
607 | | using FunctionBin = FunctionUnaryToType<BinImpl, NameBin>; |
608 | | |
609 | | struct PowImpl { |
610 | | static constexpr PrimitiveType type = TYPE_DOUBLE; |
611 | | static constexpr auto name = "pow"; |
612 | | static constexpr bool need_replace_null_data_to_default = true; |
613 | | static constexpr bool is_nullable = false; |
614 | 4 | static inline double apply(double a, double b) { return std::pow(a, b); } |
615 | | }; |
616 | | struct LogImpl { |
617 | | static constexpr PrimitiveType type = TYPE_DOUBLE; |
618 | | static constexpr auto name = "log"; |
619 | | static constexpr bool need_replace_null_data_to_default = false; |
620 | | static constexpr bool is_nullable = true; |
621 | | static constexpr double EPSILON = 1e-9; |
622 | 6 | static inline double apply(double a, double b, UInt8& is_null) { |
623 | 6 | is_null = a <= 0 || b <= 0 || std::fabs(a - 1.0) < EPSILON; |
624 | 6 | return std::log(b) / std::log(a); |
625 | 6 | } |
626 | | }; |
627 | | struct Atan2Impl { |
628 | | static constexpr PrimitiveType type = TYPE_DOUBLE; |
629 | | static constexpr auto name = "atan2"; |
630 | | static constexpr bool need_replace_null_data_to_default = false; |
631 | | static constexpr bool is_nullable = false; |
632 | 21 | static inline double apply(double a, double b) { return std::atan2(a, b); } |
633 | | }; |
634 | | |
635 | | template <typename Impl> |
636 | | class FunctionMathBinary : public IFunction { |
637 | | public: |
638 | | using cpp_type = typename PrimitiveTypeTraits<Impl::type>::CppType; |
639 | | using column_type = typename PrimitiveTypeTraits<Impl::type>::ColumnType; |
640 | | |
641 | | static constexpr auto name = Impl::name; |
642 | | static constexpr bool has_variadic_argument = |
643 | | !std::is_void_v<decltype(has_variadic_argument_types(std::declval<Impl>()))>; |
644 | | |
645 | 3 | String get_name() const override { return name; }_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE8get_nameB5cxx11Ev Line | Count | Source | 645 | 1 | String get_name() const override { return name; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE8get_nameB5cxx11Ev Line | Count | Source | 645 | 1 | String get_name() const override { return name; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE8get_nameB5cxx11Ev Line | Count | Source | 645 | 1 | String get_name() const override { return name; } |
Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE8get_nameB5cxx11Ev Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE8get_nameB5cxx11Ev |
646 | | |
647 | 54 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); }_ZN5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE6createEv Line | Count | Source | 647 | 21 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE6createEv Line | Count | Source | 647 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
|
648 | | |
649 | 42 | bool is_variadic() const override { return has_variadic_argument; }_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE11is_variadicEv Line | Count | Source | 649 | 20 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE11is_variadicEv Line | Count | Source | 649 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
|
650 | | |
651 | 12 | DataTypes get_variadic_argument_types_impl() const override { |
652 | 12 | if constexpr (has_variadic_argument) { |
653 | 9 | return Impl::get_variadic_argument_types(); |
654 | 9 | } |
655 | 0 | return {}; |
656 | 12 | } _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | | if constexpr (has_variadic_argument) { | 653 | | return Impl::get_variadic_argument_types(); | 654 | | } | 655 | 1 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | | if constexpr (has_variadic_argument) { | 653 | | return Impl::get_variadic_argument_types(); | 654 | | } | 655 | 1 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | | if constexpr (has_variadic_argument) { | 653 | | return Impl::get_variadic_argument_types(); | 654 | | } | 655 | 1 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | 1 | if constexpr (has_variadic_argument) { | 653 | 1 | return Impl::get_variadic_argument_types(); | 654 | 1 | } | 655 | 0 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | 1 | if constexpr (has_variadic_argument) { | 653 | 1 | return Impl::get_variadic_argument_types(); | 654 | 1 | } | 655 | 0 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | 1 | if constexpr (has_variadic_argument) { | 653 | 1 | return Impl::get_variadic_argument_types(); | 654 | 1 | } | 655 | 0 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | 1 | if constexpr (has_variadic_argument) { | 653 | 1 | return Impl::get_variadic_argument_types(); | 654 | 1 | } | 655 | 0 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | 1 | if constexpr (has_variadic_argument) { | 653 | 1 | return Impl::get_variadic_argument_types(); | 654 | 1 | } | 655 | 0 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | 1 | if constexpr (has_variadic_argument) { | 653 | 1 | return Impl::get_variadic_argument_types(); | 654 | 1 | } | 655 | 0 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | 1 | if constexpr (has_variadic_argument) { | 653 | 1 | return Impl::get_variadic_argument_types(); | 654 | 1 | } | 655 | 0 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | 1 | if constexpr (has_variadic_argument) { | 653 | 1 | return Impl::get_variadic_argument_types(); | 654 | 1 | } | 655 | 0 | return {}; | 656 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE32get_variadic_argument_types_implEv Line | Count | Source | 651 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 652 | 1 | if constexpr (has_variadic_argument) { | 653 | 1 | return Impl::get_variadic_argument_types(); | 654 | 1 | } | 655 | 0 | return {}; | 656 | 1 | } |
|
657 | | |
658 | 30 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
659 | 30 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); |
660 | 30 | return Impl::is_nullable ? make_nullable(res) : res; |
661 | 30 | } _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaIS8_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaIS8_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaIS8_EE Line | Count | Source | 658 | 19 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 19 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 19 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 19 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 658 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 659 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 660 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 661 | 1 | } |
|
662 | 27 | bool need_replace_null_data_to_default() const override { |
663 | 27 | return Impl::need_replace_null_data_to_default; |
664 | 27 | } _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 16 | bool need_replace_null_data_to_default() const override { | 663 | 16 | return Impl::need_replace_null_data_to_default; | 664 | 16 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 662 | 1 | bool need_replace_null_data_to_default() const override { | 663 | 1 | return Impl::need_replace_null_data_to_default; | 664 | 1 | } |
|
665 | | |
666 | 21 | size_t get_number_of_arguments() const override { return 2; }_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE23get_number_of_argumentsEv Line | Count | Source | 666 | 1 | size_t get_number_of_arguments() const override { return 2; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE23get_number_of_argumentsEv Line | Count | Source | 666 | 1 | size_t get_number_of_arguments() const override { return 2; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE23get_number_of_argumentsEv Line | Count | Source | 666 | 19 | size_t get_number_of_arguments() const override { return 2; } |
Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE23get_number_of_argumentsEv |
667 | | |
668 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
669 | 27 | uint32_t result, size_t input_rows_count) const override { |
670 | 27 | auto& column_left = block.get_by_position(arguments[0]).column; |
671 | 27 | auto& column_right = block.get_by_position(arguments[1]).column; |
672 | 27 | bool is_const_left = is_column_const(*column_left); |
673 | 27 | bool is_const_right = is_column_const(*column_right); |
674 | | |
675 | 27 | ColumnPtr column_result = nullptr; |
676 | | |
677 | 27 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; |
678 | 27 | if (is_const_left) { |
679 | 5 | column_result = constant_vector(column_left, column_right); |
680 | 22 | } else if (is_const_right) { |
681 | 5 | column_result = vector_constant(column_left, column_right); |
682 | 17 | } else { |
683 | 17 | column_result = vector_vector(column_left, column_right); |
684 | 17 | } |
685 | 27 | block.replace_by_position(result, std::move(column_result)); |
686 | | |
687 | 27 | return Status::OK(); |
688 | 27 | } _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 16 | uint32_t result, size_t input_rows_count) const override { | 670 | 16 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 16 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 16 | bool is_const_left = is_column_const(*column_left); | 673 | 16 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 16 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 16 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 16 | if (is_const_left) { | 679 | 5 | column_result = constant_vector(column_left, column_right); | 680 | 11 | } else if (is_const_right) { | 681 | 5 | column_result = vector_constant(column_left, column_right); | 682 | 6 | } else { | 683 | 6 | column_result = vector_vector(column_left, column_right); | 684 | 6 | } | 685 | 16 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 16 | return Status::OK(); | 688 | 16 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 669 | 1 | uint32_t result, size_t input_rows_count) const override { | 670 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 671 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 672 | 1 | bool is_const_left = is_column_const(*column_left); | 673 | 1 | bool is_const_right = is_column_const(*column_right); | 674 | | | 675 | 1 | ColumnPtr column_result = nullptr; | 676 | | | 677 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 678 | 1 | if (is_const_left) { | 679 | 0 | column_result = constant_vector(column_left, column_right); | 680 | 1 | } else if (is_const_right) { | 681 | 0 | column_result = vector_constant(column_left, column_right); | 682 | 1 | } else { | 683 | 1 | column_result = vector_vector(column_left, column_right); | 684 | 1 | } | 685 | 1 | block.replace_by_position(result, std::move(column_result)); | 686 | | | 687 | 1 | return Status::OK(); | 688 | 1 | } |
|
689 | | |
690 | | private: |
691 | 5 | ColumnPtr vector_constant(ColumnPtr column_left, ColumnPtr column_right) const { |
692 | 5 | const auto* column_right_ptr = assert_cast<const ColumnConst*>(column_right.get()); |
693 | 5 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left.get()); |
694 | 5 | auto column_result = column_type::create(column_left->size()); |
695 | | |
696 | 5 | if constexpr (Impl::is_nullable) { |
697 | 0 | auto null_map = ColumnUInt8::create(column_left->size(), 0); |
698 | 0 | auto& a = column_left_ptr->get_data(); |
699 | 0 | auto& c = column_result->get_data(); |
700 | 0 | auto& n = null_map->get_data(); |
701 | 0 | size_t size = a.size(); |
702 | 0 | for (size_t i = 0; i < size; ++i) { |
703 | 0 | c[i] = Impl::apply(a[i], column_right_ptr->template get_value<cpp_type>(), n[i]); |
704 | 0 | } |
705 | 0 | return ColumnNullable::create(std::move(column_result), std::move(null_map)); |
706 | 5 | } else { |
707 | 5 | auto& a = column_left_ptr->get_data(); |
708 | 5 | auto& c = column_result->get_data(); |
709 | 5 | size_t size = a.size(); |
710 | 10 | for (size_t i = 0; i < size; ++i) { |
711 | 5 | c[i] = Impl::apply(a[i], column_right_ptr->template get_value<cpp_type>()); |
712 | 5 | } |
713 | 5 | return column_result; |
714 | 5 | } |
715 | 5 | } Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ _ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ Line | Count | Source | 691 | 5 | ColumnPtr vector_constant(ColumnPtr column_left, ColumnPtr column_right) const { | 692 | 5 | const auto* column_right_ptr = assert_cast<const ColumnConst*>(column_right.get()); | 693 | 5 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left.get()); | 694 | 5 | auto column_result = column_type::create(column_left->size()); | 695 | | | 696 | | if constexpr (Impl::is_nullable) { | 697 | | auto null_map = ColumnUInt8::create(column_left->size(), 0); | 698 | | auto& a = column_left_ptr->get_data(); | 699 | | auto& c = column_result->get_data(); | 700 | | auto& n = null_map->get_data(); | 701 | | size_t size = a.size(); | 702 | | for (size_t i = 0; i < size; ++i) { | 703 | | c[i] = Impl::apply(a[i], column_right_ptr->template get_value<cpp_type>(), n[i]); | 704 | | } | 705 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 706 | 5 | } else { | 707 | 5 | auto& a = column_left_ptr->get_data(); | 708 | 5 | auto& c = column_result->get_data(); | 709 | 5 | size_t size = a.size(); | 710 | 10 | for (size_t i = 0; i < size; ++i) { | 711 | 5 | c[i] = Impl::apply(a[i], column_right_ptr->template get_value<cpp_type>()); | 712 | 5 | } | 713 | 5 | return column_result; | 714 | 5 | } | 715 | 5 | } |
Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE15vector_constantENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ |
716 | | |
717 | 5 | ColumnPtr constant_vector(ColumnPtr column_left, ColumnPtr column_right) const { |
718 | 5 | const auto* column_left_ptr = assert_cast<const ColumnConst*>(column_left.get()); |
719 | | |
720 | 5 | const auto* column_right_ptr = assert_cast<const column_type*>(column_right.get()); |
721 | 5 | auto column_result = column_type::create(column_right->size()); |
722 | | |
723 | 5 | if constexpr (Impl::is_nullable) { |
724 | 0 | auto null_map = ColumnUInt8::create(column_right->size(), 0); |
725 | 0 | auto& b = column_right_ptr->get_data(); |
726 | 0 | auto& c = column_result->get_data(); |
727 | 0 | auto& n = null_map->get_data(); |
728 | 0 | size_t size = b.size(); |
729 | 0 | for (size_t i = 0; i < size; ++i) { |
730 | 0 | c[i] = Impl::apply(column_left_ptr->template get_value<cpp_type>(), b[i], n[i]); |
731 | 0 | } |
732 | 0 | return ColumnNullable::create(std::move(column_result), std::move(null_map)); |
733 | 5 | } else { |
734 | 5 | auto& b = column_right_ptr->get_data(); |
735 | 5 | auto& c = column_result->get_data(); |
736 | 5 | size_t size = b.size(); |
737 | 10 | for (size_t i = 0; i < size; ++i) { |
738 | 5 | c[i] = Impl::apply(column_left_ptr->template get_value<cpp_type>(), b[i]); |
739 | 5 | } |
740 | 5 | return column_result; |
741 | 5 | } |
742 | 5 | } Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ _ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ Line | Count | Source | 717 | 5 | ColumnPtr constant_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 718 | 5 | const auto* column_left_ptr = assert_cast<const ColumnConst*>(column_left.get()); | 719 | | | 720 | 5 | const auto* column_right_ptr = assert_cast<const column_type*>(column_right.get()); | 721 | 5 | auto column_result = column_type::create(column_right->size()); | 722 | | | 723 | | if constexpr (Impl::is_nullable) { | 724 | | auto null_map = ColumnUInt8::create(column_right->size(), 0); | 725 | | auto& b = column_right_ptr->get_data(); | 726 | | auto& c = column_result->get_data(); | 727 | | auto& n = null_map->get_data(); | 728 | | size_t size = b.size(); | 729 | | for (size_t i = 0; i < size; ++i) { | 730 | | c[i] = Impl::apply(column_left_ptr->template get_value<cpp_type>(), b[i], n[i]); | 731 | | } | 732 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 733 | 5 | } else { | 734 | 5 | auto& b = column_right_ptr->get_data(); | 735 | 5 | auto& c = column_result->get_data(); | 736 | 5 | size_t size = b.size(); | 737 | 10 | for (size_t i = 0; i < size; ++i) { | 738 | 5 | c[i] = Impl::apply(column_left_ptr->template get_value<cpp_type>(), b[i]); | 739 | 5 | } | 740 | 5 | return column_result; | 741 | 5 | } | 742 | 5 | } |
Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Unexecuted instantiation: _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE15constant_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ |
743 | | |
744 | 17 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { |
745 | 17 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); |
746 | 17 | const auto* column_right_ptr = |
747 | 17 | assert_cast<const column_type*>(column_right->get_ptr().get()); |
748 | | |
749 | 17 | auto column_result = column_type::create(column_left->size()); |
750 | | |
751 | 17 | if constexpr (Impl::is_nullable) { |
752 | 1 | auto null_map = ColumnUInt8::create(column_result->size(), 0); |
753 | 1 | auto& a = column_left_ptr->get_data(); |
754 | 1 | auto& b = column_right_ptr->get_data(); |
755 | 1 | auto& c = column_result->get_data(); |
756 | 1 | auto& n = null_map->get_data(); |
757 | 1 | size_t size = a.size(); |
758 | 7 | for (size_t i = 0; i < size; ++i) { |
759 | 6 | c[i] = Impl::apply(a[i], b[i], n[i]); |
760 | 6 | } |
761 | 1 | return ColumnNullable::create(std::move(column_result), std::move(null_map)); |
762 | 16 | } else { |
763 | 16 | auto& a = column_left_ptr->get_data(); |
764 | 16 | auto& b = column_right_ptr->get_data(); |
765 | 16 | auto& c = column_result->get_data(); |
766 | 16 | size_t size = a.size(); |
767 | 65 | for (size_t i = 0; i < size; ++i) { |
768 | 49 | c[i] = Impl::apply(a[i], b[i]); |
769 | 49 | } |
770 | 16 | return column_result; |
771 | 16 | } |
772 | 17 | } _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | 1 | if constexpr (Impl::is_nullable) { | 752 | 1 | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | 1 | auto& a = column_left_ptr->get_data(); | 754 | 1 | auto& b = column_right_ptr->get_data(); | 755 | 1 | auto& c = column_result->get_data(); | 756 | 1 | auto& n = null_map->get_data(); | 757 | 1 | size_t size = a.size(); | 758 | 7 | for (size_t i = 0; i < size; ++i) { | 759 | 6 | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | 6 | } | 761 | 1 | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | | } else { | 763 | | auto& a = column_left_ptr->get_data(); | 764 | | auto& b = column_right_ptr->get_data(); | 765 | | auto& c = column_result->get_data(); | 766 | | size_t size = a.size(); | 767 | | for (size_t i = 0; i < size; ++i) { | 768 | | c[i] = Impl::apply(a[i], b[i]); | 769 | | } | 770 | | return column_result; | 771 | | } | 772 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 1 | } else { | 763 | 1 | auto& a = column_left_ptr->get_data(); | 764 | 1 | auto& b = column_right_ptr->get_data(); | 765 | 1 | auto& c = column_result->get_data(); | 766 | 1 | size_t size = a.size(); | 767 | 5 | for (size_t i = 0; i < size; ++i) { | 768 | 4 | c[i] = Impl::apply(a[i], b[i]); | 769 | 4 | } | 770 | 1 | return column_result; | 771 | 1 | } | 772 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ Line | Count | Source | 744 | 6 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 6 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 6 | const auto* column_right_ptr = | 747 | 6 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 6 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 6 | } else { | 763 | 6 | auto& a = column_left_ptr->get_data(); | 764 | 6 | auto& b = column_right_ptr->get_data(); | 765 | 6 | auto& c = column_result->get_data(); | 766 | 6 | size_t size = a.size(); | 767 | 17 | for (size_t i = 0; i < size; ++i) { | 768 | 11 | c[i] = Impl::apply(a[i], b[i]); | 769 | 11 | } | 770 | 6 | return column_result; | 771 | 6 | } | 772 | 6 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 1 | } else { | 763 | 1 | auto& a = column_left_ptr->get_data(); | 764 | 1 | auto& b = column_right_ptr->get_data(); | 765 | 1 | auto& c = column_result->get_data(); | 766 | 1 | size_t size = a.size(); | 767 | 7 | for (size_t i = 0; i < size; ++i) { | 768 | 6 | c[i] = Impl::apply(a[i], b[i]); | 769 | 6 | } | 770 | 1 | return column_result; | 771 | 1 | } | 772 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 1 | } else { | 763 | 1 | auto& a = column_left_ptr->get_data(); | 764 | 1 | auto& b = column_right_ptr->get_data(); | 765 | 1 | auto& c = column_result->get_data(); | 766 | 1 | size_t size = a.size(); | 767 | 3 | for (size_t i = 0; i < size; ++i) { | 768 | 2 | c[i] = Impl::apply(a[i], b[i]); | 769 | 2 | } | 770 | 1 | return column_result; | 771 | 1 | } | 772 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 1 | } else { | 763 | 1 | auto& a = column_left_ptr->get_data(); | 764 | 1 | auto& b = column_right_ptr->get_data(); | 765 | 1 | auto& c = column_result->get_data(); | 766 | 1 | size_t size = a.size(); | 767 | 9 | for (size_t i = 0; i < size; ++i) { | 768 | 8 | c[i] = Impl::apply(a[i], b[i]); | 769 | 8 | } | 770 | 1 | return column_result; | 771 | 1 | } | 772 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 1 | } else { | 763 | 1 | auto& a = column_left_ptr->get_data(); | 764 | 1 | auto& b = column_right_ptr->get_data(); | 765 | 1 | auto& c = column_result->get_data(); | 766 | 1 | size_t size = a.size(); | 767 | 3 | for (size_t i = 0; i < size; ++i) { | 768 | 2 | c[i] = Impl::apply(a[i], b[i]); | 769 | 2 | } | 770 | 1 | return column_result; | 771 | 1 | } | 772 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 1 | } else { | 763 | 1 | auto& a = column_left_ptr->get_data(); | 764 | 1 | auto& b = column_right_ptr->get_data(); | 765 | 1 | auto& c = column_result->get_data(); | 766 | 1 | size_t size = a.size(); | 767 | 3 | for (size_t i = 0; i < size; ++i) { | 768 | 2 | c[i] = Impl::apply(a[i], b[i]); | 769 | 2 | } | 770 | 1 | return column_result; | 771 | 1 | } | 772 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 1 | } else { | 763 | 1 | auto& a = column_left_ptr->get_data(); | 764 | 1 | auto& b = column_right_ptr->get_data(); | 765 | 1 | auto& c = column_result->get_data(); | 766 | 1 | size_t size = a.size(); | 767 | 3 | for (size_t i = 0; i < size; ++i) { | 768 | 2 | c[i] = Impl::apply(a[i], b[i]); | 769 | 2 | } | 770 | 1 | return column_result; | 771 | 1 | } | 772 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 1 | } else { | 763 | 1 | auto& a = column_left_ptr->get_data(); | 764 | 1 | auto& b = column_right_ptr->get_data(); | 765 | 1 | auto& c = column_result->get_data(); | 766 | 1 | size_t size = a.size(); | 767 | 9 | for (size_t i = 0; i < size; ++i) { | 768 | 8 | c[i] = Impl::apply(a[i], b[i]); | 769 | 8 | } | 770 | 1 | return column_result; | 771 | 1 | } | 772 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 1 | } else { | 763 | 1 | auto& a = column_left_ptr->get_data(); | 764 | 1 | auto& b = column_right_ptr->get_data(); | 765 | 1 | auto& c = column_result->get_data(); | 766 | 1 | size_t size = a.size(); | 767 | 3 | for (size_t i = 0; i < size; ++i) { | 768 | 2 | c[i] = Impl::apply(a[i], b[i]); | 769 | 2 | } | 770 | 1 | return column_result; | 771 | 1 | } | 772 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 744 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 745 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 746 | 1 | const auto* column_right_ptr = | 747 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 748 | | | 749 | 1 | auto column_result = column_type::create(column_left->size()); | 750 | | | 751 | | if constexpr (Impl::is_nullable) { | 752 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 753 | | auto& a = column_left_ptr->get_data(); | 754 | | auto& b = column_right_ptr->get_data(); | 755 | | auto& c = column_result->get_data(); | 756 | | auto& n = null_map->get_data(); | 757 | | size_t size = a.size(); | 758 | | for (size_t i = 0; i < size; ++i) { | 759 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 760 | | } | 761 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 762 | 1 | } else { | 763 | 1 | auto& a = column_left_ptr->get_data(); | 764 | 1 | auto& b = column_right_ptr->get_data(); | 765 | 1 | auto& c = column_result->get_data(); | 766 | 1 | size_t size = a.size(); | 767 | 3 | for (size_t i = 0; i < size; ++i) { | 768 | 2 | c[i] = Impl::apply(a[i], b[i]); | 769 | 2 | } | 770 | 1 | return column_result; | 771 | 1 | } | 772 | 1 | } |
|
773 | | }; |
774 | | |
775 | | class FunctionNormalCdf : public IFunction { |
776 | | public: |
777 | | static constexpr auto name = "normal_cdf"; |
778 | | |
779 | 1 | String get_name() const override { return name; } |
780 | | |
781 | 2 | static FunctionPtr create() { return std::make_shared<FunctionNormalCdf>(); } |
782 | | |
783 | 0 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
784 | 0 | return make_nullable(std::make_shared<DataTypeFloat64>()); |
785 | 0 | } |
786 | | |
787 | 1 | DataTypes get_variadic_argument_types_impl() const override { |
788 | 1 | return {std::make_shared<DataTypeFloat64>(), std::make_shared<DataTypeFloat64>(), |
789 | 1 | std::make_shared<DataTypeFloat64>()}; |
790 | 1 | } |
791 | 0 | size_t get_number_of_arguments() const override { return 3; } |
792 | | |
793 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
794 | 0 | uint32_t result, size_t input_rows_count) const override { |
795 | 0 | auto result_column = ColumnFloat64::create(input_rows_count); |
796 | 0 | auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); |
797 | |
|
798 | 0 | auto& result_data = result_column->get_data(); |
799 | 0 | NullMap& result_null_map = |
800 | 0 | assert_cast<ColumnUInt8*>(result_null_map_column.get())->get_data(); |
801 | |
|
802 | 0 | ColumnPtr argument_columns[3]; |
803 | 0 | bool col_const[3]; |
804 | 0 | size_t argument_size = arguments.size(); |
805 | 0 | for (int i = 0; i < argument_size; ++i) { |
806 | 0 | argument_columns[i] = block.get_by_position(arguments[i]).column; |
807 | 0 | col_const[i] = is_column_const(*argument_columns[i]); |
808 | 0 | if (col_const[i]) { |
809 | 0 | argument_columns[i] = |
810 | 0 | static_cast<const ColumnConst&>(*argument_columns[i]).get_data_column_ptr(); |
811 | 0 | } |
812 | 0 | } |
813 | |
|
814 | 0 | const auto* mean_col = assert_cast<const ColumnFloat64*>(argument_columns[0].get()); |
815 | 0 | const auto* sd_col = assert_cast<const ColumnFloat64*>(argument_columns[1].get()); |
816 | 0 | const auto* value_col = assert_cast<const ColumnFloat64*>(argument_columns[2].get()); |
817 | |
|
818 | 0 | result_column->reserve(input_rows_count); |
819 | 0 | for (size_t i = 0; i < input_rows_count; ++i) { |
820 | 0 | double mean = mean_col->get_element(index_check_const(i, col_const[0])); |
821 | 0 | double sd = sd_col->get_element(index_check_const(i, col_const[1])); |
822 | 0 | double v = value_col->get_element(index_check_const(i, col_const[2])); |
823 | |
|
824 | 0 | if (!check_argument(sd)) [[unlikely]] { |
825 | 0 | result_null_map[i] = true; |
826 | 0 | continue; |
827 | 0 | } |
828 | 0 | result_data[i] = calculate_cell(mean, sd, v); |
829 | 0 | } |
830 | |
|
831 | 0 | block.get_by_position(result).column = |
832 | 0 | ColumnNullable::create(std::move(result_column), std::move(result_null_map_column)); |
833 | 0 | return Status::OK(); |
834 | 0 | } |
835 | | |
836 | 0 | static bool check_argument(double sd) { return sd > 0; } |
837 | 0 | static double calculate_cell(double mean, double sd, double v) { |
838 | | #ifdef __APPLE__ |
839 | | const double sqrt2 = std::sqrt(2); |
840 | | #else |
841 | 0 | constexpr double sqrt2 = std::numbers::sqrt2; |
842 | 0 | #endif |
843 | |
|
844 | 0 | return 0.5 * (std::erf((v - mean) / (sd * sqrt2)) + 1); |
845 | 0 | } |
846 | | }; |
847 | | |
848 | | template <typename A> |
849 | | struct SignBitImpl { |
850 | | static constexpr PrimitiveType ResultType = TYPE_BOOLEAN; |
851 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
852 | 6 | static inline bool apply(A a) { return std::signbit(static_cast<Float64>(a)); } |
853 | | }; |
854 | | |
855 | | struct NameSignBit { |
856 | | static constexpr auto name = "signbit"; |
857 | | }; |
858 | | |
859 | | using FunctionSignBit = FunctionUnaryArithmetic<SignBitImpl<double>, NameSignBit, TYPE_DOUBLE>; |
860 | | |
861 | 9 | double EvenImpl(double a) { |
862 | 9 | double mag = std::abs(a); |
863 | 9 | double even_mag = 2 * std::ceil(mag / 2); |
864 | 9 | return std::copysign(even_mag, a); |
865 | 9 | } |
866 | | |
867 | | struct NameEven { |
868 | | static constexpr auto name = "even"; |
869 | | }; |
870 | | |
871 | | using FunctionEven = FunctionMathUnary<UnaryFunctionPlain<NameEven, EvenImpl>>; |
872 | | |
873 | | template <PrimitiveType A> |
874 | | struct GcdImpl { |
875 | | using cpp_type = typename PrimitiveTypeTraits<A>::CppType; |
876 | | |
877 | | static constexpr PrimitiveType type = A; |
878 | | static constexpr auto name = "gcd"; |
879 | | static constexpr bool need_replace_null_data_to_default = false; |
880 | | static constexpr bool is_nullable = false; |
881 | | |
882 | 5 | static DataTypes get_variadic_argument_types() { |
883 | 5 | using datatype = typename PrimitiveTypeTraits<A>::DataType; |
884 | 5 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; |
885 | 5 | } _ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE3EE27get_variadic_argument_typesEv Line | Count | Source | 882 | 1 | static DataTypes get_variadic_argument_types() { | 883 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 884 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 885 | 1 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE4EE27get_variadic_argument_typesEv Line | Count | Source | 882 | 1 | static DataTypes get_variadic_argument_types() { | 883 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 884 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 885 | 1 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE5EE27get_variadic_argument_typesEv Line | Count | Source | 882 | 1 | static DataTypes get_variadic_argument_types() { | 883 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 884 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 885 | 1 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE6EE27get_variadic_argument_typesEv Line | Count | Source | 882 | 1 | static DataTypes get_variadic_argument_types() { | 883 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 884 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 885 | 1 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE7EE27get_variadic_argument_typesEv Line | Count | Source | 882 | 1 | static DataTypes get_variadic_argument_types() { | 883 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 884 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 885 | 1 | } |
|
886 | | |
887 | 20 | static inline cpp_type apply(cpp_type a, cpp_type b) { |
888 | 20 | return static_cast<cpp_type>(std::gcd(a, b)); |
889 | 20 | } _ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE3EE5applyEaa Line | Count | Source | 887 | 6 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 888 | 6 | return static_cast<cpp_type>(std::gcd(a, b)); | 889 | 6 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE4EE5applyEss Line | Count | Source | 887 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 888 | 2 | return static_cast<cpp_type>(std::gcd(a, b)); | 889 | 2 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE5EE5applyEii Line | Count | Source | 887 | 8 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 888 | 8 | return static_cast<cpp_type>(std::gcd(a, b)); | 889 | 8 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE6EE5applyEll Line | Count | Source | 887 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 888 | 2 | return static_cast<cpp_type>(std::gcd(a, b)); | 889 | 2 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE7EE5applyEnn Line | Count | Source | 887 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 888 | 2 | return static_cast<cpp_type>(std::gcd(a, b)); | 889 | 2 | } |
|
890 | | }; |
891 | | |
892 | | template <PrimitiveType A> |
893 | | struct LcmImpl { |
894 | | using cpp_type = typename PrimitiveTypeTraits<A>::CppType; |
895 | | |
896 | | static constexpr PrimitiveType type = A; |
897 | | static constexpr auto name = "lcm"; |
898 | | static constexpr bool need_replace_null_data_to_default = false; |
899 | | static constexpr bool is_nullable = false; |
900 | | |
901 | 4 | static DataTypes get_variadic_argument_types() { |
902 | 4 | using datatype = typename PrimitiveTypeTraits<A>::DataType; |
903 | 4 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; |
904 | 4 | } _ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE4EE27get_variadic_argument_typesEv Line | Count | Source | 901 | 1 | static DataTypes get_variadic_argument_types() { | 902 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 903 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 904 | 1 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE5EE27get_variadic_argument_typesEv Line | Count | Source | 901 | 1 | static DataTypes get_variadic_argument_types() { | 902 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 903 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 904 | 1 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE6EE27get_variadic_argument_typesEv Line | Count | Source | 901 | 1 | static DataTypes get_variadic_argument_types() { | 902 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 903 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 904 | 1 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE7EE27get_variadic_argument_typesEv Line | Count | Source | 901 | 1 | static DataTypes get_variadic_argument_types() { | 902 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 903 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 904 | 1 | } |
|
905 | | |
906 | 14 | static inline cpp_type apply(cpp_type a, cpp_type b) { |
907 | 14 | return static_cast<cpp_type>(std::lcm(a, b)); |
908 | 14 | } _ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE4EE5applyEss Line | Count | Source | 906 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 907 | 2 | return static_cast<cpp_type>(std::lcm(a, b)); | 908 | 2 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE5EE5applyEii Line | Count | Source | 906 | 8 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 907 | 8 | return static_cast<cpp_type>(std::lcm(a, b)); | 908 | 8 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE6EE5applyEll Line | Count | Source | 906 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 907 | 2 | return static_cast<cpp_type>(std::lcm(a, b)); | 908 | 2 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE7EE5applyEnn Line | Count | Source | 906 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 907 | 2 | return static_cast<cpp_type>(std::lcm(a, b)); | 908 | 2 | } |
|
909 | | }; |
910 | | |
911 | | enum class FloatPointNumberJudgmentType { |
912 | | IsNan = 0, |
913 | | IsInf, |
914 | | }; |
915 | | |
916 | | struct ImplIsNan { |
917 | | static constexpr auto name = "isnan"; |
918 | | static constexpr FloatPointNumberJudgmentType type = FloatPointNumberJudgmentType::IsNan; |
919 | | }; |
920 | | |
921 | | struct ImplIsInf { |
922 | | static constexpr auto name = "isinf"; |
923 | | static constexpr FloatPointNumberJudgmentType type = FloatPointNumberJudgmentType::IsInf; |
924 | | }; |
925 | | |
926 | | template <typename Impl> |
927 | | class FunctionFloatingPointNumberJudgment : public IFunction { |
928 | | public: |
929 | | using IFunction::execute; |
930 | | |
931 | | static constexpr auto name = Impl::name; |
932 | 8 | static FunctionPtr create() { return std::make_shared<FunctionFloatingPointNumberJudgment>(); }_ZN5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE6createEv Line | Count | Source | 932 | 4 | static FunctionPtr create() { return std::make_shared<FunctionFloatingPointNumberJudgment>(); } |
_ZN5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE6createEv Line | Count | Source | 932 | 4 | static FunctionPtr create() { return std::make_shared<FunctionFloatingPointNumberJudgment>(); } |
|
933 | | |
934 | | private: |
935 | 2 | String get_name() const override { return name; }_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE8get_nameB5cxx11Ev Line | Count | Source | 935 | 1 | String get_name() const override { return name; } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE8get_nameB5cxx11Ev Line | Count | Source | 935 | 1 | String get_name() const override { return name; } |
|
936 | 4 | size_t get_number_of_arguments() const override { return 1; }_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE23get_number_of_argumentsEv Line | Count | Source | 936 | 2 | size_t get_number_of_arguments() const override { return 1; } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE23get_number_of_argumentsEv Line | Count | Source | 936 | 2 | size_t get_number_of_arguments() const override { return 1; } |
|
937 | | |
938 | 4 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
939 | 4 | return std::make_shared<DataTypeBool>(); |
940 | 4 | } _ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaIS8_EE Line | Count | Source | 938 | 2 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 939 | 2 | return std::make_shared<DataTypeBool>(); | 940 | 2 | } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaIS8_EE Line | Count | Source | 938 | 2 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 939 | 2 | return std::make_shared<DataTypeBool>(); | 940 | 2 | } |
|
941 | | |
942 | | void execute_impl_with_type(const auto* input_column, |
943 | 4 | DataTypeBool::ColumnType::Container& output, size_t size) const { |
944 | 32 | for (int i = 0; i < size; i++) { |
945 | 28 | auto value = input_column->get_element(i); |
946 | 28 | if constexpr (Impl::type == FloatPointNumberJudgmentType::IsNan) { |
947 | 14 | output[i] = std::isnan(value); |
948 | 14 | } else if constexpr (Impl::type == FloatPointNumberJudgmentType::IsInf) { |
949 | 14 | output[i] = std::isinf(value); |
950 | 14 | } |
951 | 28 | } |
952 | 4 | } _ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE22execute_impl_with_typeINS0_12ColumnVectorILNS_13PrimitiveTypeE9EEEEEvPKT_RNS0_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEEm Line | Count | Source | 943 | 1 | DataTypeBool::ColumnType::Container& output, size_t size) const { | 944 | 8 | for (int i = 0; i < size; i++) { | 945 | 7 | auto value = input_column->get_element(i); | 946 | 7 | if constexpr (Impl::type == FloatPointNumberJudgmentType::IsNan) { | 947 | 7 | output[i] = std::isnan(value); | 948 | | } else if constexpr (Impl::type == FloatPointNumberJudgmentType::IsInf) { | 949 | | output[i] = std::isinf(value); | 950 | | } | 951 | 7 | } | 952 | 1 | } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE22execute_impl_with_typeINS0_12ColumnVectorILNS_13PrimitiveTypeE8EEEEEvPKT_RNS0_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEEm Line | Count | Source | 943 | 1 | DataTypeBool::ColumnType::Container& output, size_t size) const { | 944 | 8 | for (int i = 0; i < size; i++) { | 945 | 7 | auto value = input_column->get_element(i); | 946 | 7 | if constexpr (Impl::type == FloatPointNumberJudgmentType::IsNan) { | 947 | 7 | output[i] = std::isnan(value); | 948 | | } else if constexpr (Impl::type == FloatPointNumberJudgmentType::IsInf) { | 949 | | output[i] = std::isinf(value); | 950 | | } | 951 | 7 | } | 952 | 1 | } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE22execute_impl_with_typeINS0_12ColumnVectorILNS_13PrimitiveTypeE9EEEEEvPKT_RNS0_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEEm Line | Count | Source | 943 | 1 | DataTypeBool::ColumnType::Container& output, size_t size) const { | 944 | 8 | for (int i = 0; i < size; i++) { | 945 | 7 | auto value = input_column->get_element(i); | 946 | | if constexpr (Impl::type == FloatPointNumberJudgmentType::IsNan) { | 947 | | output[i] = std::isnan(value); | 948 | 7 | } else if constexpr (Impl::type == FloatPointNumberJudgmentType::IsInf) { | 949 | 7 | output[i] = std::isinf(value); | 950 | 7 | } | 951 | 7 | } | 952 | 1 | } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE22execute_impl_with_typeINS0_12ColumnVectorILNS_13PrimitiveTypeE8EEEEEvPKT_RNS0_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEEm Line | Count | Source | 943 | 1 | DataTypeBool::ColumnType::Container& output, size_t size) const { | 944 | 8 | for (int i = 0; i < size; i++) { | 945 | 7 | auto value = input_column->get_element(i); | 946 | | if constexpr (Impl::type == FloatPointNumberJudgmentType::IsNan) { | 947 | | output[i] = std::isnan(value); | 948 | 7 | } else if constexpr (Impl::type == FloatPointNumberJudgmentType::IsInf) { | 949 | 7 | output[i] = std::isinf(value); | 950 | 7 | } | 951 | 7 | } | 952 | 1 | } |
|
953 | | |
954 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
955 | 4 | uint32_t result, size_t input_rows_count) const override { |
956 | 4 | auto dst = DataTypeBool::ColumnType::create(); |
957 | 4 | auto& dst_data = dst->get_data(); |
958 | 4 | dst_data.resize(input_rows_count); |
959 | 4 | const auto* column = block.get_by_position(arguments[0]).column.get(); |
960 | 4 | if (const auto* col_f64 = check_and_get_column<ColumnFloat64>(column)) { |
961 | 2 | execute_impl_with_type(col_f64, dst_data, input_rows_count); |
962 | 2 | } else if (const auto* col_f32 = check_and_get_column<ColumnFloat32>(column)) { |
963 | 2 | execute_impl_with_type(col_f32, dst_data, input_rows_count); |
964 | 2 | } else { |
965 | 0 | return Status::InvalidArgument("Unsupported column type {} for function {}", |
966 | 0 | column->get_name(), get_name()); |
967 | 0 | } |
968 | 4 | block.replace_by_position(result, std::move(dst)); |
969 | 4 | return Status::OK(); |
970 | 4 | } _ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 955 | 2 | uint32_t result, size_t input_rows_count) const override { | 956 | 2 | auto dst = DataTypeBool::ColumnType::create(); | 957 | 2 | auto& dst_data = dst->get_data(); | 958 | 2 | dst_data.resize(input_rows_count); | 959 | 2 | const auto* column = block.get_by_position(arguments[0]).column.get(); | 960 | 2 | if (const auto* col_f64 = check_and_get_column<ColumnFloat64>(column)) { | 961 | 1 | execute_impl_with_type(col_f64, dst_data, input_rows_count); | 962 | 1 | } else if (const auto* col_f32 = check_and_get_column<ColumnFloat32>(column)) { | 963 | 1 | execute_impl_with_type(col_f32, dst_data, input_rows_count); | 964 | 1 | } else { | 965 | 0 | return Status::InvalidArgument("Unsupported column type {} for function {}", | 966 | 0 | column->get_name(), get_name()); | 967 | 0 | } | 968 | 2 | block.replace_by_position(result, std::move(dst)); | 969 | 2 | return Status::OK(); | 970 | 2 | } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 955 | 2 | uint32_t result, size_t input_rows_count) const override { | 956 | 2 | auto dst = DataTypeBool::ColumnType::create(); | 957 | 2 | auto& dst_data = dst->get_data(); | 958 | 2 | dst_data.resize(input_rows_count); | 959 | 2 | const auto* column = block.get_by_position(arguments[0]).column.get(); | 960 | 2 | if (const auto* col_f64 = check_and_get_column<ColumnFloat64>(column)) { | 961 | 1 | execute_impl_with_type(col_f64, dst_data, input_rows_count); | 962 | 1 | } else if (const auto* col_f32 = check_and_get_column<ColumnFloat32>(column)) { | 963 | 1 | execute_impl_with_type(col_f32, dst_data, input_rows_count); | 964 | 1 | } else { | 965 | 0 | return Status::InvalidArgument("Unsupported column type {} for function {}", | 966 | 0 | column->get_name(), get_name()); | 967 | 0 | } | 968 | 2 | block.replace_by_position(result, std::move(dst)); | 969 | 2 | return Status::OK(); | 970 | 2 | } |
|
971 | | }; |
972 | | |
973 | | using FunctionIsNan = FunctionFloatingPointNumberJudgment<ImplIsNan>; |
974 | | using FunctionIsInf = FunctionFloatingPointNumberJudgment<ImplIsInf>; |
975 | | |
976 | 1 | void register_function_math(SimpleFunctionFactory& factory) { |
977 | 1 | factory.register_function<FunctionAcos>(); |
978 | 1 | factory.register_function<FunctionAcosh>(); |
979 | 1 | factory.register_function<FunctionAsin>(); |
980 | 1 | factory.register_function<FunctionAsinh>(); |
981 | 1 | factory.register_function<FunctionAtan>(); |
982 | 1 | factory.register_function<FunctionAtanh>(); |
983 | 1 | factory.register_function<FunctionMathBinary<LogImpl>>(); |
984 | 1 | factory.register_function<FunctionMathBinary<PowImpl>>(); |
985 | 1 | factory.register_function<FunctionMathBinary<Atan2Impl>>(); |
986 | 1 | factory.register_function<FunctionCos>(); |
987 | 1 | factory.register_function<FunctionCosh>(); |
988 | 1 | factory.register_function<FunctionE>(); |
989 | 1 | factory.register_alias("ln", "dlog1"); |
990 | 1 | factory.register_function<FunctionMathLog<ImplLn>>(); |
991 | 1 | factory.register_function<FunctionMathLog<ImplLog2>>(); |
992 | 1 | factory.register_function<FunctionMathLog<ImplLog10>>(); |
993 | 1 | factory.register_alias("log10", "dlog10"); |
994 | 1 | factory.register_function<FunctionPi>(); |
995 | 1 | factory.register_function<FunctionSign>(); |
996 | 1 | factory.register_function<FunctionAbsInt8>(); |
997 | 1 | factory.register_function<FunctionAbsInt16>(); |
998 | 1 | factory.register_function<FunctionAbsInt32>(); |
999 | 1 | factory.register_function<FunctionAbsInt64>(); |
1000 | 1 | factory.register_function<FunctionAbsInt128>(); |
1001 | 1 | factory.register_function<FunctionAbsUInt8>(); |
1002 | 1 | factory.register_function<FunctionAbsDecimal32>(); |
1003 | 1 | factory.register_function<FunctionAbsDecimal64>(); |
1004 | 1 | factory.register_function<FunctionAbsDecimalV3>(); |
1005 | 1 | factory.register_function<FunctionAbsDecimalV2>(); |
1006 | 1 | factory.register_function<FunctionAbsDecimal256>(); |
1007 | 1 | factory.register_function<FunctionAbsFloat>(); |
1008 | 1 | factory.register_function<FunctionAbsDouble>(); |
1009 | 1 | factory.register_function<FunctionNegativeDouble>(); |
1010 | 1 | factory.register_function<FunctionNegativeBigInt>(); |
1011 | 1 | factory.register_function<FunctionNegativeDecimalV2>(); |
1012 | 1 | factory.register_function<FunctionNegativeDecimal256>(); |
1013 | 1 | factory.register_function<FunctionNegativeDecimalV3>(); |
1014 | 1 | factory.register_function<FunctionNegativeDecimal32>(); |
1015 | 1 | factory.register_function<FunctionNegativeDecimal64>(); |
1016 | | |
1017 | 1 | factory.register_function<FunctionPositiveDecimal32>(); |
1018 | 1 | factory.register_function<FunctionPositiveDecimal64>(); |
1019 | 1 | factory.register_function<FunctionPositiveDecimalV3>(); |
1020 | 1 | factory.register_function<FunctionPositiveDecimalV2>(); |
1021 | 1 | factory.register_function<FunctionPositiveDecimal256>(); |
1022 | 1 | factory.register_function<FunctionPositiveDouble>(); |
1023 | 1 | factory.register_function<FunctionPositiveBigInt>(); |
1024 | | |
1025 | 1 | factory.register_function<FunctionSin>(); |
1026 | 1 | factory.register_function<FunctionSinh>(); |
1027 | 1 | factory.register_function<FunctionSqrt>(); |
1028 | 1 | factory.register_alias("sqrt", "dsqrt"); |
1029 | 1 | factory.register_function<FunctionCbrt>(); |
1030 | 1 | factory.register_function<FunctionTan>(); |
1031 | 1 | factory.register_function<FunctionTanh>(); |
1032 | 1 | factory.register_function<FunctionCot>(); |
1033 | 1 | factory.register_function<FunctionSec>(); |
1034 | 1 | factory.register_function<FunctionCosec>(); |
1035 | 1 | factory.register_alias("pow", "power"); |
1036 | 1 | factory.register_alias("pow", "dpow"); |
1037 | 1 | factory.register_alias("pow", "fpow"); |
1038 | 1 | factory.register_function<FunctionExp>(); |
1039 | 1 | factory.register_alias("exp", "dexp"); |
1040 | 1 | factory.register_function<FunctionFactorial>(); |
1041 | 1 | factory.register_function<FunctionRadians>(); |
1042 | 1 | factory.register_function<FunctionDegrees>(); |
1043 | 1 | factory.register_function<FunctionBin>(); |
1044 | 1 | factory.register_function<FunctionNormalCdf>(); |
1045 | 1 | factory.register_function<FunctionSignBit>(); |
1046 | 1 | factory.register_function<FunctionEven>(); |
1047 | 1 | factory.register_function<FunctionMathBinary<GcdImpl<TYPE_TINYINT>>>(); |
1048 | 1 | factory.register_function<FunctionMathBinary<GcdImpl<TYPE_SMALLINT>>>(); |
1049 | 1 | factory.register_function<FunctionMathBinary<GcdImpl<TYPE_INT>>>(); |
1050 | 1 | factory.register_function<FunctionMathBinary<GcdImpl<TYPE_BIGINT>>>(); |
1051 | 1 | factory.register_function<FunctionMathBinary<GcdImpl<TYPE_LARGEINT>>>(); |
1052 | 1 | factory.register_function<FunctionMathBinary<LcmImpl<TYPE_SMALLINT>>>(); |
1053 | 1 | factory.register_function<FunctionMathBinary<LcmImpl<TYPE_INT>>>(); |
1054 | 1 | factory.register_function<FunctionMathBinary<LcmImpl<TYPE_BIGINT>>>(); |
1055 | 1 | factory.register_function<FunctionMathBinary<LcmImpl<TYPE_LARGEINT>>>(); |
1056 | 1 | factory.register_function<FunctionIsNan>(); |
1057 | 1 | factory.register_function<FunctionIsInf>(); |
1058 | 1 | } |
1059 | | } // namespace doris::vectorized |