/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 (IsDecimal128V2<A>) { |
220 | 0 | return DecimalV2Value(a < A(0) ? A(-a) : a); |
221 | 0 | } else if constexpr (IsDecimalNumber<A>) { |
222 | 0 | return a < A(0) ? A(-a) : a; |
223 | 7 | } else if constexpr (IsIntegralV<A>) { |
224 | 7 | return a < A(0) ? static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( |
225 | 3 | ~a) + |
226 | 3 | 1 |
227 | 7 | : a; |
228 | 7 | } else if constexpr (std::is_floating_point_v<A>) { |
229 | 5 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( |
230 | 5 | std::abs(a)); |
231 | | } else { |
232 | | static_assert(std::is_same_v<A, void>, "Unsupported type in AbsImpl"); |
233 | | } |
234 | 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 (IsDecimal128V2<A>) { | 220 | | return DecimalV2Value(a < A(0) ? A(-a) : a); | 221 | | } else if constexpr (IsDecimalNumber<A>) { | 222 | | return a < A(0) ? A(-a) : a; | 223 | 7 | } else if constexpr (IsIntegralV<A>) { | 224 | 7 | return a < A(0) ? static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( | 225 | 3 | ~a) + | 226 | 3 | 1 | 227 | 7 | : a; | 228 | | } else if constexpr (std::is_floating_point_v<A>) { | 229 | | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( | 230 | | std::abs(a)); | 231 | | } else { | 232 | | static_assert(std::is_same_v<A, void>, "Unsupported type in AbsImpl"); | 233 | | } | 234 | 7 | } |
Unexecuted instantiation: _ZN5doris10vectorized7AbsImplIlE5applyEl Unexecuted instantiation: _ZN5doris10vectorized7AbsImplInE5applyEn Unexecuted instantiation: _ZN5doris10vectorized7AbsImplIhE5applyEh Unexecuted instantiation: _ZN5doris10vectorized7AbsImplINS0_7DecimalIiEEE5applyES3_ Unexecuted instantiation: _ZN5doris10vectorized7AbsImplINS0_7DecimalIlEEE5applyES3_ Unexecuted instantiation: _ZN5doris10vectorized7AbsImplINS0_12Decimal128V3EE5applyES2_ Unexecuted instantiation: _ZN5doris10vectorized7AbsImplINS_14DecimalV2ValueEE5applyES2_ 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 (IsDecimal128V2<A>) { | 220 | | return DecimalV2Value(a < A(0) ? A(-a) : a); | 221 | | } else if constexpr (IsDecimalNumber<A>) { | 222 | | return a < A(0) ? A(-a) : a; | 223 | | } else if constexpr (IsIntegralV<A>) { | 224 | | return a < A(0) ? static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( | 225 | | ~a) + | 226 | | 1 | 227 | | : a; | 228 | 5 | } else if constexpr (std::is_floating_point_v<A>) { | 229 | 5 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>( | 230 | 5 | std::abs(a)); | 231 | | } else { | 232 | | static_assert(std::is_same_v<A, void>, "Unsupported type in AbsImpl"); | 233 | | } | 234 | 5 | } |
|
235 | | }; |
236 | | |
237 | | struct NameAbs { |
238 | | static constexpr auto name = "abs"; |
239 | | }; |
240 | | |
241 | | template <typename A> |
242 | | struct ResultOfPosAndNegTive; |
243 | | |
244 | | template <> |
245 | | struct ResultOfPosAndNegTive<Int64> { |
246 | | static constexpr PrimitiveType ResultType = TYPE_BIGINT; |
247 | | }; |
248 | | template <> |
249 | | struct ResultOfPosAndNegTive<double> { |
250 | | static constexpr PrimitiveType ResultType = TYPE_DOUBLE; |
251 | | }; |
252 | | |
253 | | template <> |
254 | | struct ResultOfPosAndNegTive<Decimal32> { |
255 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL32; |
256 | | }; |
257 | | |
258 | | template <> |
259 | | struct ResultOfPosAndNegTive<Decimal64> { |
260 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL64; |
261 | | }; |
262 | | |
263 | | template <> |
264 | | struct ResultOfPosAndNegTive<Decimal128V2> { |
265 | | static constexpr PrimitiveType ResultType = TYPE_DECIMALV2; |
266 | | }; |
267 | | |
268 | | template <> |
269 | | struct ResultOfPosAndNegTive<DecimalV2Value> { |
270 | | static constexpr PrimitiveType ResultType = TYPE_DECIMALV2; |
271 | | }; |
272 | | |
273 | | template <> |
274 | | struct ResultOfPosAndNegTive<Decimal128V3> { |
275 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL128I; |
276 | | }; |
277 | | |
278 | | template <> |
279 | | struct ResultOfPosAndNegTive<Decimal256> { |
280 | | static constexpr PrimitiveType ResultType = TYPE_DECIMAL256; |
281 | | }; |
282 | | |
283 | | using FunctionAbsUInt8 = FunctionUnaryArithmetic<AbsImpl<UInt8>, NameAbs, TYPE_BOOLEAN>; |
284 | | using FunctionAbsInt8 = FunctionUnaryArithmetic<AbsImpl<Int8>, NameAbs, TYPE_TINYINT>; |
285 | | using FunctionAbsInt16 = FunctionUnaryArithmetic<AbsImpl<Int16>, NameAbs, TYPE_SMALLINT>; |
286 | | using FunctionAbsInt32 = FunctionUnaryArithmetic<AbsImpl<Int32>, NameAbs, TYPE_INT>; |
287 | | using FunctionAbsInt64 = FunctionUnaryArithmetic<AbsImpl<Int64>, NameAbs, TYPE_BIGINT>; |
288 | | using FunctionAbsInt128 = FunctionUnaryArithmetic<AbsImpl<Int128>, NameAbs, TYPE_LARGEINT>; |
289 | | using FunctionAbsDecimal32 = FunctionUnaryArithmetic<AbsImpl<Decimal32>, NameAbs, TYPE_DECIMAL32>; |
290 | | using FunctionAbsDecimal64 = FunctionUnaryArithmetic<AbsImpl<Decimal64>, NameAbs, TYPE_DECIMAL64>; |
291 | | using FunctionAbsDecimalV3 = |
292 | | FunctionUnaryArithmetic<AbsImpl<Decimal128V3>, NameAbs, TYPE_DECIMAL128I>; |
293 | | using FunctionAbsDecimalV2 = |
294 | | FunctionUnaryArithmetic<AbsImpl<DecimalV2Value>, NameAbs, TYPE_DECIMALV2>; |
295 | | using FunctionAbsDecimal256 = |
296 | | FunctionUnaryArithmetic<AbsImpl<Decimal256>, NameAbs, TYPE_DECIMAL256>; |
297 | | using FunctionAbsFloat = FunctionUnaryArithmetic<AbsImpl<float>, NameAbs, TYPE_FLOAT>; |
298 | | using FunctionAbsDouble = FunctionUnaryArithmetic<AbsImpl<double>, NameAbs, TYPE_DOUBLE>; |
299 | | |
300 | | template <typename A> |
301 | | struct NegativeImpl { |
302 | | static constexpr PrimitiveType ResultType = ResultOfPosAndNegTive<A>::ResultType; |
303 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
304 | | NO_SANITIZE_UNDEFINED static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType |
305 | 4 | apply(A a) { |
306 | 4 | return -a; |
307 | 4 | } _ZN5doris10vectorized12NegativeImplIdE5applyEd Line | Count | Source | 305 | 4 | apply(A a) { | 306 | 4 | return -a; | 307 | 4 | } |
Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplIlE5applyEl Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplINS_14DecimalV2ValueEE5applyES2_ Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplINS0_7DecimalIN4wide7integerILm256EiEEEEE5applyES6_ Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplINS0_12Decimal128V3EE5applyES2_ Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplINS0_7DecimalIiEEE5applyES3_ Unexecuted instantiation: _ZN5doris10vectorized12NegativeImplINS0_7DecimalIlEEE5applyES3_ |
308 | | }; |
309 | | |
310 | | struct NameNegative { |
311 | | static constexpr auto name = "negative"; |
312 | | }; |
313 | | |
314 | | using FunctionNegativeDouble = |
315 | | FunctionUnaryArithmetic<NegativeImpl<double>, NameNegative, TYPE_DOUBLE>; |
316 | | using FunctionNegativeBigInt = |
317 | | FunctionUnaryArithmetic<NegativeImpl<Int64>, NameNegative, TYPE_BIGINT>; |
318 | | using FunctionNegativeDecimalV2 = |
319 | | FunctionUnaryArithmetic<NegativeImpl<DecimalV2Value>, NameNegative, TYPE_DECIMALV2>; |
320 | | using FunctionNegativeDecimal256 = |
321 | | FunctionUnaryArithmetic<NegativeImpl<Decimal256>, NameNegative, TYPE_DECIMAL256>; |
322 | | using FunctionNegativeDecimalV3 = |
323 | | FunctionUnaryArithmetic<NegativeImpl<Decimal128V3>, NameNegative, TYPE_DECIMAL128I>; |
324 | | using FunctionNegativeDecimal32 = |
325 | | FunctionUnaryArithmetic<NegativeImpl<Decimal32>, NameNegative, TYPE_DECIMAL32>; |
326 | | using FunctionNegativeDecimal64 = |
327 | | FunctionUnaryArithmetic<NegativeImpl<Decimal64>, NameNegative, TYPE_DECIMAL64>; |
328 | | |
329 | | template <typename A> |
330 | | struct PositiveImpl { |
331 | | static constexpr PrimitiveType ResultType = ResultOfPosAndNegTive<A>::ResultType; |
332 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
333 | 8 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { |
334 | 8 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>(a); |
335 | 8 | } Unexecuted instantiation: _ZN5doris10vectorized12PositiveImplINS0_7DecimalIiEEE5applyES3_ _ZN5doris10vectorized12PositiveImplINS0_7DecimalIlEEE5applyES3_ Line | Count | Source | 333 | 4 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { | 334 | 4 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>(a); | 335 | 4 | } |
Unexecuted instantiation: _ZN5doris10vectorized12PositiveImplINS0_12Decimal128V3EE5applyES2_ Unexecuted instantiation: _ZN5doris10vectorized12PositiveImplINS_14DecimalV2ValueEE5applyES2_ Unexecuted instantiation: _ZN5doris10vectorized12PositiveImplINS0_7DecimalIN4wide7integerILm256EiEEEEE5applyES6_ _ZN5doris10vectorized12PositiveImplIdE5applyEd Line | Count | Source | 333 | 4 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { | 334 | 4 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>(a); | 335 | 4 | } |
Unexecuted instantiation: _ZN5doris10vectorized12PositiveImplIlE5applyEl |
336 | | }; |
337 | | |
338 | | struct NamePositive { |
339 | | static constexpr auto name = "positive"; |
340 | | }; |
341 | | |
342 | | using FunctionPositiveDouble = |
343 | | FunctionUnaryArithmetic<PositiveImpl<double>, NamePositive, TYPE_DOUBLE>; |
344 | | using FunctionPositiveBigInt = |
345 | | FunctionUnaryArithmetic<PositiveImpl<Int64>, NamePositive, TYPE_BIGINT>; |
346 | | using FunctionPositiveDecimalV2 = |
347 | | FunctionUnaryArithmetic<PositiveImpl<DecimalV2Value>, NamePositive, TYPE_DECIMALV2>; |
348 | | using FunctionPositiveDecimal256 = |
349 | | FunctionUnaryArithmetic<PositiveImpl<Decimal256>, NamePositive, TYPE_DECIMAL256>; |
350 | | using FunctionPositiveDecimalV3 = |
351 | | FunctionUnaryArithmetic<PositiveImpl<Decimal128V3>, NamePositive, TYPE_DECIMAL128I>; |
352 | | using FunctionPositiveDecimal32 = |
353 | | FunctionUnaryArithmetic<PositiveImpl<Decimal32>, NamePositive, TYPE_DECIMAL32>; |
354 | | using FunctionPositiveDecimal64 = |
355 | | FunctionUnaryArithmetic<PositiveImpl<Decimal64>, NamePositive, TYPE_DECIMAL64>; |
356 | | |
357 | | struct SinName { |
358 | | static constexpr auto name = "sin"; |
359 | | }; |
360 | | using FunctionSin = FunctionMathUnary<UnaryFunctionPlain<SinName, std::sin>>; |
361 | | |
362 | | struct SinhName { |
363 | | static constexpr auto name = "sinh"; |
364 | | }; |
365 | | using FunctionSinh = FunctionMathUnary<UnaryFunctionPlain<SinhName, std::sinh>>; |
366 | | |
367 | | struct SqrtName { |
368 | | static constexpr auto name = "sqrt"; |
369 | | // https://dev.mysql.com/doc/refman/8.4/en/mathematical-functions.html#function_sqrt |
370 | 4 | static constexpr bool is_invalid_input(Float64 x) { return x < 0; } |
371 | | }; |
372 | | using FunctionSqrt = |
373 | | FunctionMathUnaryAlwayNullable<UnaryFunctionPlainAlwayNullable<SqrtName, std::sqrt>>; |
374 | | |
375 | | struct CbrtName { |
376 | | static constexpr auto name = "cbrt"; |
377 | | }; |
378 | | using FunctionCbrt = FunctionMathUnary<UnaryFunctionPlain<CbrtName, std::cbrt>>; |
379 | | |
380 | | struct TanName { |
381 | | static constexpr auto name = "tan"; |
382 | | }; |
383 | | using FunctionTan = FunctionMathUnary<UnaryFunctionPlain<TanName, std::tan>>; |
384 | | |
385 | | struct TanhName { |
386 | | static constexpr auto name = "tanh"; |
387 | | }; |
388 | | using FunctionTanh = FunctionMathUnary<UnaryFunctionPlain<TanhName, std::tanh>>; |
389 | | |
390 | | struct CotName { |
391 | | static constexpr auto name = "cot"; |
392 | | }; |
393 | 2 | double cot(double x) { |
394 | 2 | return 1.0 / std::tan(x); |
395 | 2 | } |
396 | | using FunctionCot = FunctionMathUnary<UnaryFunctionPlain<CotName, cot>>; |
397 | | |
398 | | struct SecName { |
399 | | static constexpr auto name = "sec"; |
400 | | }; |
401 | 2 | double sec(double x) { |
402 | 2 | return 1.0 / std::cos(x); |
403 | 2 | } |
404 | | using FunctionSec = FunctionMathUnary<UnaryFunctionPlain<SecName, sec>>; |
405 | | |
406 | | struct CscName { |
407 | | static constexpr auto name = "csc"; |
408 | | }; |
409 | 3 | double csc(double x) { |
410 | 3 | return 1.0 / std::sin(x); |
411 | 3 | } |
412 | | using FunctionCosec = FunctionMathUnary<UnaryFunctionPlain<CscName, csc>>; |
413 | | |
414 | | static const Int64 FACT_TABLE[] = {1LL, |
415 | | 1LL, |
416 | | 2LL, |
417 | | 6LL, |
418 | | 24LL, |
419 | | 120LL, |
420 | | 720LL, |
421 | | 5040LL, |
422 | | 40320LL, |
423 | | 362880LL, |
424 | | 3628800LL, |
425 | | 39916800LL, |
426 | | 479001600LL, |
427 | | 6227020800LL, |
428 | | 87178291200LL, |
429 | | 1307674368000LL, |
430 | | 20922789888000LL, |
431 | | 355687428096000LL, |
432 | | 6402373705728000LL, |
433 | | 121645100408832000LL, |
434 | | 2432902008176640000LL}; |
435 | | |
436 | | class FunctionFactorial : public IFunction { |
437 | | public: |
438 | | static constexpr auto name = "factorial"; |
439 | 16 | static FunctionPtr create() { return std::make_shared<FunctionFactorial>(); } |
440 | | |
441 | | private: |
442 | 1 | String get_name() const override { return name; } |
443 | 14 | size_t get_number_of_arguments() const override { return 1; } |
444 | | |
445 | 14 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
446 | 14 | return make_nullable(std::make_shared<DataTypeInt64>()); |
447 | 14 | } |
448 | | |
449 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
450 | 12 | uint32_t result, size_t input_rows_count) const override { |
451 | 12 | const auto* data_col = |
452 | 12 | check_and_get_column<ColumnInt64>(block.get_by_position(arguments[0]).column.get()); |
453 | 12 | if (!data_col) { |
454 | 0 | return Status::InternalError( |
455 | 0 | "Unexpected column '%s' for argument of function %s", |
456 | 0 | block.get_by_position(arguments[0]).column->get_name().c_str(), get_name()); |
457 | 0 | } |
458 | | |
459 | 12 | auto result_column = ColumnInt64::create(input_rows_count); |
460 | 12 | auto result_null_map = ColumnUInt8::create(input_rows_count, 0); |
461 | 12 | auto& result_data = result_column->get_data(); |
462 | 12 | auto& result_null_map_data = result_null_map->get_data(); |
463 | | |
464 | 12 | const auto& src_data = data_col->get_data(); |
465 | 30 | for (size_t i = 0; i < input_rows_count; ++i) { |
466 | 18 | Int64 n = src_data[i]; |
467 | 18 | if (n < 0 || n > 20) { |
468 | 6 | result_null_map_data[i] = 1; |
469 | 6 | result_data[i] = 0; |
470 | 12 | } else { |
471 | 12 | result_data[i] = FACT_TABLE[n]; |
472 | 12 | } |
473 | 18 | } |
474 | | |
475 | 12 | block.replace_by_position(result, ColumnNullable::create(std::move(result_column), |
476 | 12 | std::move(result_null_map))); |
477 | | |
478 | 12 | return Status::OK(); |
479 | 12 | } |
480 | | }; |
481 | | |
482 | | template <typename A> |
483 | | struct RadiansImpl { |
484 | | static constexpr PrimitiveType ResultType = TYPE_DOUBLE; |
485 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
486 | 4 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { |
487 | 4 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>(a / 180.0 * |
488 | 4 | PiImpl::value); |
489 | 4 | } |
490 | | }; |
491 | | |
492 | | struct NameRadians { |
493 | | static constexpr auto name = "radians"; |
494 | | }; |
495 | | |
496 | | using FunctionRadians = FunctionUnaryArithmetic<RadiansImpl<double>, NameRadians, TYPE_DOUBLE>; |
497 | | |
498 | | template <typename A> |
499 | | struct DegreesImpl { |
500 | | static constexpr PrimitiveType ResultType = TYPE_DOUBLE; |
501 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
502 | 4 | static inline typename PrimitiveTypeTraits<ResultType>::ColumnItemType apply(A a) { |
503 | 4 | return static_cast<typename PrimitiveTypeTraits<ResultType>::ColumnItemType>(a * 180.0 / |
504 | 4 | PiImpl::value); |
505 | 4 | } |
506 | | }; |
507 | | |
508 | | struct NameDegrees { |
509 | | static constexpr auto name = "degrees"; |
510 | | }; |
511 | | |
512 | | using FunctionDegrees = FunctionUnaryArithmetic<DegreesImpl<double>, NameDegrees, TYPE_DOUBLE>; |
513 | | |
514 | | struct NameBin { |
515 | | static constexpr auto name = "bin"; |
516 | | }; |
517 | | struct BinImpl { |
518 | | using ReturnType = DataTypeString; |
519 | | static constexpr auto PrimitiveTypeImpl = PrimitiveType::TYPE_BIGINT; |
520 | | using Type = Int64; |
521 | | using ReturnColumnType = ColumnString; |
522 | | |
523 | 4 | static std::string bin_impl(Int64 value) { |
524 | 4 | auto n = static_cast<uint64_t>(value); |
525 | 4 | const size_t max_bits = sizeof(uint64_t) * 8; |
526 | 4 | char result[max_bits]; |
527 | 4 | uint32_t index = max_bits; |
528 | 7 | do { |
529 | 7 | result[--index] = '0' + (n & 1); |
530 | 7 | } while (n >>= 1); |
531 | 4 | return std::string(result + index, max_bits - index); |
532 | 4 | } |
533 | | |
534 | | static Status vector(const ColumnInt64::Container& data, ColumnString::Chars& res_data, |
535 | 1 | ColumnString::Offsets& res_offsets) { |
536 | 1 | res_offsets.resize(data.size()); |
537 | 1 | size_t input_size = res_offsets.size(); |
538 | | |
539 | 5 | for (size_t i = 0; i < input_size; ++i) { |
540 | 4 | StringOP::push_value_string(bin_impl(data[i]), i, res_data, res_offsets); |
541 | 4 | } |
542 | 1 | return Status::OK(); |
543 | 1 | } |
544 | | }; |
545 | | |
546 | | using FunctionBin = FunctionUnaryToType<BinImpl, NameBin>; |
547 | | |
548 | | struct PowImpl { |
549 | | static constexpr PrimitiveType type = TYPE_DOUBLE; |
550 | | static constexpr auto name = "pow"; |
551 | | static constexpr bool need_replace_null_data_to_default = true; |
552 | | static constexpr bool is_nullable = false; |
553 | 4 | static inline double apply(double a, double b) { return std::pow(a, b); } |
554 | | }; |
555 | | struct LogImpl { |
556 | | static constexpr PrimitiveType type = TYPE_DOUBLE; |
557 | | static constexpr auto name = "log"; |
558 | | static constexpr bool need_replace_null_data_to_default = false; |
559 | | static constexpr bool is_nullable = true; |
560 | | static constexpr double EPSILON = 1e-9; |
561 | 6 | static inline double apply(double a, double b, UInt8& is_null) { |
562 | 6 | is_null = a <= 0 || b <= 0 || std::fabs(a - 1.0) < EPSILON; |
563 | 6 | return std::log(b) / std::log(a); |
564 | 6 | } |
565 | | }; |
566 | | struct Atan2Impl { |
567 | | static constexpr PrimitiveType type = TYPE_DOUBLE; |
568 | | static constexpr auto name = "atan2"; |
569 | | static constexpr bool need_replace_null_data_to_default = false; |
570 | | static constexpr bool is_nullable = false; |
571 | 21 | static inline double apply(double a, double b) { return std::atan2(a, b); } |
572 | | }; |
573 | | |
574 | | template <typename Impl> |
575 | | class FunctionMathBinary : public IFunction { |
576 | | public: |
577 | | using cpp_type = typename PrimitiveTypeTraits<Impl::type>::CppType; |
578 | | using column_type = typename PrimitiveTypeTraits<Impl::type>::ColumnType; |
579 | | |
580 | | static constexpr auto name = Impl::name; |
581 | | static constexpr bool has_variadic_argument = |
582 | | !std::is_void_v<decltype(has_variadic_argument_types(std::declval<Impl>()))>; |
583 | | |
584 | 3 | String get_name() const override { return name; }_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE8get_nameB5cxx11Ev Line | Count | Source | 584 | 1 | String get_name() const override { return name; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE8get_nameB5cxx11Ev Line | Count | Source | 584 | 1 | String get_name() const override { return name; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE8get_nameB5cxx11Ev Line | Count | Source | 584 | 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 |
585 | | |
586 | 54 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); }_ZN5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE6createEv Line | Count | Source | 586 | 21 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
_ZN5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE6createEv Line | Count | Source | 586 | 3 | static FunctionPtr create() { return std::make_shared<FunctionMathBinary<Impl>>(); } |
|
587 | | |
588 | 42 | bool is_variadic() const override { return has_variadic_argument; }_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE11is_variadicEv Line | Count | Source | 588 | 20 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE11is_variadicEv Line | Count | Source | 588 | 2 | bool is_variadic() const override { return has_variadic_argument; } |
|
589 | | |
590 | 12 | DataTypes get_variadic_argument_types_impl() const override { |
591 | 12 | if constexpr (has_variadic_argument) { |
592 | 9 | return Impl::get_variadic_argument_types(); |
593 | 9 | } |
594 | 0 | return {}; |
595 | 12 | } _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | | if constexpr (has_variadic_argument) { | 592 | | return Impl::get_variadic_argument_types(); | 593 | | } | 594 | 1 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | | if constexpr (has_variadic_argument) { | 592 | | return Impl::get_variadic_argument_types(); | 593 | | } | 594 | 1 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | | if constexpr (has_variadic_argument) { | 592 | | return Impl::get_variadic_argument_types(); | 593 | | } | 594 | 1 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | 1 | if constexpr (has_variadic_argument) { | 592 | 1 | return Impl::get_variadic_argument_types(); | 593 | 1 | } | 594 | 0 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | 1 | if constexpr (has_variadic_argument) { | 592 | 1 | return Impl::get_variadic_argument_types(); | 593 | 1 | } | 594 | 0 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | 1 | if constexpr (has_variadic_argument) { | 592 | 1 | return Impl::get_variadic_argument_types(); | 593 | 1 | } | 594 | 0 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | 1 | if constexpr (has_variadic_argument) { | 592 | 1 | return Impl::get_variadic_argument_types(); | 593 | 1 | } | 594 | 0 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | 1 | if constexpr (has_variadic_argument) { | 592 | 1 | return Impl::get_variadic_argument_types(); | 593 | 1 | } | 594 | 0 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | 1 | if constexpr (has_variadic_argument) { | 592 | 1 | return Impl::get_variadic_argument_types(); | 593 | 1 | } | 594 | 0 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | 1 | if constexpr (has_variadic_argument) { | 592 | 1 | return Impl::get_variadic_argument_types(); | 593 | 1 | } | 594 | 0 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | 1 | if constexpr (has_variadic_argument) { | 592 | 1 | return Impl::get_variadic_argument_types(); | 593 | 1 | } | 594 | 0 | return {}; | 595 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE32get_variadic_argument_types_implEv Line | Count | Source | 590 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 591 | 1 | if constexpr (has_variadic_argument) { | 592 | 1 | return Impl::get_variadic_argument_types(); | 593 | 1 | } | 594 | 0 | return {}; | 595 | 1 | } |
|
596 | | |
597 | 30 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
598 | 30 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); |
599 | 30 | return Impl::is_nullable ? make_nullable(res) : res; |
600 | 30 | } _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaIS8_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaIS8_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaIS8_EE Line | Count | Source | 597 | 19 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 19 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 19 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 19 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaISA_EE Line | Count | Source | 597 | 1 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 598 | 1 | auto res = std::make_shared<DataTypeNumber<Impl::type>>(); | 599 | 1 | return Impl::is_nullable ? make_nullable(res) : res; | 600 | 1 | } |
|
601 | 27 | bool need_replace_null_data_to_default() const override { |
602 | 27 | return Impl::need_replace_null_data_to_default; |
603 | 27 | } _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 16 | bool need_replace_null_data_to_default() const override { | 602 | 16 | return Impl::need_replace_null_data_to_default; | 603 | 16 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE33need_replace_null_data_to_defaultEv Line | Count | Source | 601 | 1 | bool need_replace_null_data_to_default() const override { | 602 | 1 | return Impl::need_replace_null_data_to_default; | 603 | 1 | } |
|
604 | | |
605 | 21 | size_t get_number_of_arguments() const override { return 2; }_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE23get_number_of_argumentsEv Line | Count | Source | 605 | 1 | size_t get_number_of_arguments() const override { return 2; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE23get_number_of_argumentsEv Line | Count | Source | 605 | 1 | size_t get_number_of_arguments() const override { return 2; } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE23get_number_of_argumentsEv Line | Count | Source | 605 | 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 |
606 | | |
607 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
608 | 27 | uint32_t result, size_t input_rows_count) const override { |
609 | 27 | auto& column_left = block.get_by_position(arguments[0]).column; |
610 | 27 | auto& column_right = block.get_by_position(arguments[1]).column; |
611 | 27 | bool is_const_left = is_column_const(*column_left); |
612 | 27 | bool is_const_right = is_column_const(*column_right); |
613 | | |
614 | 27 | ColumnPtr column_result = nullptr; |
615 | | |
616 | 27 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; |
617 | 27 | if (is_const_left) { |
618 | 5 | column_result = constant_vector(column_left, column_right); |
619 | 22 | } else if (is_const_right) { |
620 | 5 | column_result = vector_constant(column_left, column_right); |
621 | 17 | } else { |
622 | 17 | column_result = vector_vector(column_left, column_right); |
623 | 17 | } |
624 | 27 | block.replace_by_position(result, std::move(column_result)); |
625 | | |
626 | 27 | return Status::OK(); |
627 | 27 | } _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 16 | uint32_t result, size_t input_rows_count) const override { | 609 | 16 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 16 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 16 | bool is_const_left = is_column_const(*column_left); | 612 | 16 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 16 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 16 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 16 | if (is_const_left) { | 618 | 5 | column_result = constant_vector(column_left, column_right); | 619 | 11 | } else if (is_const_right) { | 620 | 5 | column_result = vector_constant(column_left, column_right); | 621 | 6 | } else { | 622 | 6 | column_result = vector_vector(column_left, column_right); | 623 | 6 | } | 624 | 16 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 16 | return Status::OK(); | 627 | 16 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 608 | 1 | uint32_t result, size_t input_rows_count) const override { | 609 | 1 | auto& column_left = block.get_by_position(arguments[0]).column; | 610 | 1 | auto& column_right = block.get_by_position(arguments[1]).column; | 611 | 1 | bool is_const_left = is_column_const(*column_left); | 612 | 1 | bool is_const_right = is_column_const(*column_right); | 613 | | | 614 | 1 | ColumnPtr column_result = nullptr; | 615 | | | 616 | 1 | DCHECK(!(is_const_left && is_const_right)) << "both of column can not be const"; | 617 | 1 | if (is_const_left) { | 618 | 0 | column_result = constant_vector(column_left, column_right); | 619 | 1 | } else if (is_const_right) { | 620 | 0 | column_result = vector_constant(column_left, column_right); | 621 | 1 | } else { | 622 | 1 | column_result = vector_vector(column_left, column_right); | 623 | 1 | } | 624 | 1 | block.replace_by_position(result, std::move(column_result)); | 625 | | | 626 | 1 | return Status::OK(); | 627 | 1 | } |
|
628 | | |
629 | | private: |
630 | 5 | ColumnPtr vector_constant(ColumnPtr column_left, ColumnPtr column_right) const { |
631 | 5 | const auto* column_right_ptr = assert_cast<const ColumnConst*>(column_right.get()); |
632 | 5 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left.get()); |
633 | 5 | auto column_result = column_type::create(column_left->size()); |
634 | | |
635 | 5 | if constexpr (Impl::is_nullable) { |
636 | 0 | auto null_map = ColumnUInt8::create(column_left->size(), 0); |
637 | 0 | auto& a = column_left_ptr->get_data(); |
638 | 0 | auto& c = column_result->get_data(); |
639 | 0 | auto& n = null_map->get_data(); |
640 | 0 | size_t size = a.size(); |
641 | 0 | for (size_t i = 0; i < size; ++i) { |
642 | 0 | c[i] = Impl::apply(a[i], column_right_ptr->template get_value<Impl::type>(), n[i]); |
643 | 0 | } |
644 | 0 | return ColumnNullable::create(std::move(column_result), std::move(null_map)); |
645 | 5 | } else { |
646 | 5 | auto& a = column_left_ptr->get_data(); |
647 | 5 | auto& c = column_result->get_data(); |
648 | 5 | size_t size = a.size(); |
649 | 10 | for (size_t i = 0; i < size; ++i) { |
650 | 5 | c[i] = Impl::apply(a[i], column_right_ptr->template get_value<Impl::type>()); |
651 | 5 | } |
652 | 5 | return column_result; |
653 | 5 | } |
654 | 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 | 630 | 5 | ColumnPtr vector_constant(ColumnPtr column_left, ColumnPtr column_right) const { | 631 | 5 | const auto* column_right_ptr = assert_cast<const ColumnConst*>(column_right.get()); | 632 | 5 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left.get()); | 633 | 5 | auto column_result = column_type::create(column_left->size()); | 634 | | | 635 | | if constexpr (Impl::is_nullable) { | 636 | | auto null_map = ColumnUInt8::create(column_left->size(), 0); | 637 | | auto& a = column_left_ptr->get_data(); | 638 | | auto& c = column_result->get_data(); | 639 | | auto& n = null_map->get_data(); | 640 | | size_t size = a.size(); | 641 | | for (size_t i = 0; i < size; ++i) { | 642 | | c[i] = Impl::apply(a[i], column_right_ptr->template get_value<Impl::type>(), n[i]); | 643 | | } | 644 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 645 | 5 | } else { | 646 | 5 | auto& a = column_left_ptr->get_data(); | 647 | 5 | auto& c = column_result->get_data(); | 648 | 5 | size_t size = a.size(); | 649 | 10 | for (size_t i = 0; i < size; ++i) { | 650 | 5 | c[i] = Impl::apply(a[i], column_right_ptr->template get_value<Impl::type>()); | 651 | 5 | } | 652 | 5 | return column_result; | 653 | 5 | } | 654 | 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_ |
655 | | |
656 | 5 | ColumnPtr constant_vector(ColumnPtr column_left, ColumnPtr column_right) const { |
657 | 5 | const auto* column_left_ptr = assert_cast<const ColumnConst*>(column_left.get()); |
658 | | |
659 | 5 | const auto* column_right_ptr = assert_cast<const column_type*>(column_right.get()); |
660 | 5 | auto column_result = column_type::create(column_right->size()); |
661 | | |
662 | 5 | if constexpr (Impl::is_nullable) { |
663 | 0 | auto null_map = ColumnUInt8::create(column_right->size(), 0); |
664 | 0 | auto& b = column_right_ptr->get_data(); |
665 | 0 | auto& c = column_result->get_data(); |
666 | 0 | auto& n = null_map->get_data(); |
667 | 0 | size_t size = b.size(); |
668 | 0 | for (size_t i = 0; i < size; ++i) { |
669 | 0 | c[i] = Impl::apply(column_left_ptr->template get_value<Impl::type>(), b[i], n[i]); |
670 | 0 | } |
671 | 0 | return ColumnNullable::create(std::move(column_result), std::move(null_map)); |
672 | 5 | } else { |
673 | 5 | auto& b = column_right_ptr->get_data(); |
674 | 5 | auto& c = column_result->get_data(); |
675 | 5 | size_t size = b.size(); |
676 | 10 | for (size_t i = 0; i < size; ++i) { |
677 | 5 | c[i] = Impl::apply(column_left_ptr->template get_value<Impl::type>(), b[i]); |
678 | 5 | } |
679 | 5 | return column_result; |
680 | 5 | } |
681 | 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 | 656 | 5 | ColumnPtr constant_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 657 | 5 | const auto* column_left_ptr = assert_cast<const ColumnConst*>(column_left.get()); | 658 | | | 659 | 5 | const auto* column_right_ptr = assert_cast<const column_type*>(column_right.get()); | 660 | 5 | auto column_result = column_type::create(column_right->size()); | 661 | | | 662 | | if constexpr (Impl::is_nullable) { | 663 | | auto null_map = ColumnUInt8::create(column_right->size(), 0); | 664 | | auto& b = column_right_ptr->get_data(); | 665 | | auto& c = column_result->get_data(); | 666 | | auto& n = null_map->get_data(); | 667 | | size_t size = b.size(); | 668 | | for (size_t i = 0; i < size; ++i) { | 669 | | c[i] = Impl::apply(column_left_ptr->template get_value<Impl::type>(), b[i], n[i]); | 670 | | } | 671 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 672 | 5 | } else { | 673 | 5 | auto& b = column_right_ptr->get_data(); | 674 | 5 | auto& c = column_result->get_data(); | 675 | 5 | size_t size = b.size(); | 676 | 10 | for (size_t i = 0; i < size; ++i) { | 677 | 5 | c[i] = Impl::apply(column_left_ptr->template get_value<Impl::type>(), b[i]); | 678 | 5 | } | 679 | 5 | return column_result; | 680 | 5 | } | 681 | 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_ |
682 | | |
683 | 17 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { |
684 | 17 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); |
685 | 17 | const auto* column_right_ptr = |
686 | 17 | assert_cast<const column_type*>(column_right->get_ptr().get()); |
687 | | |
688 | 17 | auto column_result = column_type::create(column_left->size()); |
689 | | |
690 | 17 | if constexpr (Impl::is_nullable) { |
691 | 1 | auto null_map = ColumnUInt8::create(column_result->size(), 0); |
692 | 1 | auto& a = column_left_ptr->get_data(); |
693 | 1 | auto& b = column_right_ptr->get_data(); |
694 | 1 | auto& c = column_result->get_data(); |
695 | 1 | auto& n = null_map->get_data(); |
696 | 1 | size_t size = a.size(); |
697 | 7 | for (size_t i = 0; i < size; ++i) { |
698 | 6 | c[i] = Impl::apply(a[i], b[i], n[i]); |
699 | 6 | } |
700 | 1 | return ColumnNullable::create(std::move(column_result), std::move(null_map)); |
701 | 16 | } else { |
702 | 16 | auto& a = column_left_ptr->get_data(); |
703 | 16 | auto& b = column_right_ptr->get_data(); |
704 | 16 | auto& c = column_result->get_data(); |
705 | 16 | size_t size = a.size(); |
706 | 65 | for (size_t i = 0; i < size; ++i) { |
707 | 49 | c[i] = Impl::apply(a[i], b[i]); |
708 | 49 | } |
709 | 16 | return column_result; |
710 | 16 | } |
711 | 17 | } _ZNK5doris10vectorized18FunctionMathBinaryINS0_7LogImplEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | 1 | if constexpr (Impl::is_nullable) { | 691 | 1 | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | 1 | auto& a = column_left_ptr->get_data(); | 693 | 1 | auto& b = column_right_ptr->get_data(); | 694 | 1 | auto& c = column_result->get_data(); | 695 | 1 | auto& n = null_map->get_data(); | 696 | 1 | size_t size = a.size(); | 697 | 7 | for (size_t i = 0; i < size; ++i) { | 698 | 6 | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | 6 | } | 700 | 1 | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | | } else { | 702 | | auto& a = column_left_ptr->get_data(); | 703 | | auto& b = column_right_ptr->get_data(); | 704 | | auto& c = column_result->get_data(); | 705 | | size_t size = a.size(); | 706 | | for (size_t i = 0; i < size; ++i) { | 707 | | c[i] = Impl::apply(a[i], b[i]); | 708 | | } | 709 | | return column_result; | 710 | | } | 711 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7PowImplEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 1 | } else { | 702 | 1 | auto& a = column_left_ptr->get_data(); | 703 | 1 | auto& b = column_right_ptr->get_data(); | 704 | 1 | auto& c = column_result->get_data(); | 705 | 1 | size_t size = a.size(); | 706 | 5 | for (size_t i = 0; i < size; ++i) { | 707 | 4 | c[i] = Impl::apply(a[i], b[i]); | 708 | 4 | } | 709 | 1 | return column_result; | 710 | 1 | } | 711 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_9Atan2ImplEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS5_EES8_ Line | Count | Source | 683 | 6 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 6 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 6 | const auto* column_right_ptr = | 686 | 6 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 6 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 6 | } else { | 702 | 6 | auto& a = column_left_ptr->get_data(); | 703 | 6 | auto& b = column_right_ptr->get_data(); | 704 | 6 | auto& c = column_result->get_data(); | 705 | 6 | size_t size = a.size(); | 706 | 17 | for (size_t i = 0; i < size; ++i) { | 707 | 11 | c[i] = Impl::apply(a[i], b[i]); | 708 | 11 | } | 709 | 6 | return column_result; | 710 | 6 | } | 711 | 6 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE3EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 1 | } else { | 702 | 1 | auto& a = column_left_ptr->get_data(); | 703 | 1 | auto& b = column_right_ptr->get_data(); | 704 | 1 | auto& c = column_result->get_data(); | 705 | 1 | size_t size = a.size(); | 706 | 7 | for (size_t i = 0; i < size; ++i) { | 707 | 6 | c[i] = Impl::apply(a[i], b[i]); | 708 | 6 | } | 709 | 1 | return column_result; | 710 | 1 | } | 711 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE4EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 1 | } else { | 702 | 1 | auto& a = column_left_ptr->get_data(); | 703 | 1 | auto& b = column_right_ptr->get_data(); | 704 | 1 | auto& c = column_result->get_data(); | 705 | 1 | size_t size = a.size(); | 706 | 3 | for (size_t i = 0; i < size; ++i) { | 707 | 2 | c[i] = Impl::apply(a[i], b[i]); | 708 | 2 | } | 709 | 1 | return column_result; | 710 | 1 | } | 711 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE5EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 1 | } else { | 702 | 1 | auto& a = column_left_ptr->get_data(); | 703 | 1 | auto& b = column_right_ptr->get_data(); | 704 | 1 | auto& c = column_result->get_data(); | 705 | 1 | size_t size = a.size(); | 706 | 9 | for (size_t i = 0; i < size; ++i) { | 707 | 8 | c[i] = Impl::apply(a[i], b[i]); | 708 | 8 | } | 709 | 1 | return column_result; | 710 | 1 | } | 711 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE6EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 1 | } else { | 702 | 1 | auto& a = column_left_ptr->get_data(); | 703 | 1 | auto& b = column_right_ptr->get_data(); | 704 | 1 | auto& c = column_result->get_data(); | 705 | 1 | size_t size = a.size(); | 706 | 3 | for (size_t i = 0; i < size; ++i) { | 707 | 2 | c[i] = Impl::apply(a[i], b[i]); | 708 | 2 | } | 709 | 1 | return column_result; | 710 | 1 | } | 711 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7GcdImplILNS_13PrimitiveTypeE7EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 1 | } else { | 702 | 1 | auto& a = column_left_ptr->get_data(); | 703 | 1 | auto& b = column_right_ptr->get_data(); | 704 | 1 | auto& c = column_result->get_data(); | 705 | 1 | size_t size = a.size(); | 706 | 3 | for (size_t i = 0; i < size; ++i) { | 707 | 2 | c[i] = Impl::apply(a[i], b[i]); | 708 | 2 | } | 709 | 1 | return column_result; | 710 | 1 | } | 711 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE4EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 1 | } else { | 702 | 1 | auto& a = column_left_ptr->get_data(); | 703 | 1 | auto& b = column_right_ptr->get_data(); | 704 | 1 | auto& c = column_result->get_data(); | 705 | 1 | size_t size = a.size(); | 706 | 3 | for (size_t i = 0; i < size; ++i) { | 707 | 2 | c[i] = Impl::apply(a[i], b[i]); | 708 | 2 | } | 709 | 1 | return column_result; | 710 | 1 | } | 711 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE5EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 1 | } else { | 702 | 1 | auto& a = column_left_ptr->get_data(); | 703 | 1 | auto& b = column_right_ptr->get_data(); | 704 | 1 | auto& c = column_result->get_data(); | 705 | 1 | size_t size = a.size(); | 706 | 9 | for (size_t i = 0; i < size; ++i) { | 707 | 8 | c[i] = Impl::apply(a[i], b[i]); | 708 | 8 | } | 709 | 1 | return column_result; | 710 | 1 | } | 711 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE6EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 1 | } else { | 702 | 1 | auto& a = column_left_ptr->get_data(); | 703 | 1 | auto& b = column_right_ptr->get_data(); | 704 | 1 | auto& c = column_result->get_data(); | 705 | 1 | size_t size = a.size(); | 706 | 3 | for (size_t i = 0; i < size; ++i) { | 707 | 2 | c[i] = Impl::apply(a[i], b[i]); | 708 | 2 | } | 709 | 1 | return column_result; | 710 | 1 | } | 711 | 1 | } |
_ZNK5doris10vectorized18FunctionMathBinaryINS0_7LcmImplILNS_13PrimitiveTypeE7EEEE13vector_vectorENS_3COWINS0_7IColumnEE13immutable_ptrIS7_EESA_ Line | Count | Source | 683 | 1 | ColumnPtr vector_vector(ColumnPtr column_left, ColumnPtr column_right) const { | 684 | 1 | const auto* column_left_ptr = assert_cast<const column_type*>(column_left->get_ptr().get()); | 685 | 1 | const auto* column_right_ptr = | 686 | 1 | assert_cast<const column_type*>(column_right->get_ptr().get()); | 687 | | | 688 | 1 | auto column_result = column_type::create(column_left->size()); | 689 | | | 690 | | if constexpr (Impl::is_nullable) { | 691 | | auto null_map = ColumnUInt8::create(column_result->size(), 0); | 692 | | auto& a = column_left_ptr->get_data(); | 693 | | auto& b = column_right_ptr->get_data(); | 694 | | auto& c = column_result->get_data(); | 695 | | auto& n = null_map->get_data(); | 696 | | size_t size = a.size(); | 697 | | for (size_t i = 0; i < size; ++i) { | 698 | | c[i] = Impl::apply(a[i], b[i], n[i]); | 699 | | } | 700 | | return ColumnNullable::create(std::move(column_result), std::move(null_map)); | 701 | 1 | } else { | 702 | 1 | auto& a = column_left_ptr->get_data(); | 703 | 1 | auto& b = column_right_ptr->get_data(); | 704 | 1 | auto& c = column_result->get_data(); | 705 | 1 | size_t size = a.size(); | 706 | 3 | for (size_t i = 0; i < size; ++i) { | 707 | 2 | c[i] = Impl::apply(a[i], b[i]); | 708 | 2 | } | 709 | 1 | return column_result; | 710 | 1 | } | 711 | 1 | } |
|
712 | | }; |
713 | | |
714 | | class FunctionNormalCdf : public IFunction { |
715 | | public: |
716 | | static constexpr auto name = "normal_cdf"; |
717 | | |
718 | 1 | String get_name() const override { return name; } |
719 | | |
720 | 2 | static FunctionPtr create() { return std::make_shared<FunctionNormalCdf>(); } |
721 | | |
722 | 0 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
723 | 0 | return make_nullable(std::make_shared<DataTypeFloat64>()); |
724 | 0 | } |
725 | | |
726 | 1 | DataTypes get_variadic_argument_types_impl() const override { |
727 | 1 | return {std::make_shared<DataTypeFloat64>(), std::make_shared<DataTypeFloat64>(), |
728 | 1 | std::make_shared<DataTypeFloat64>()}; |
729 | 1 | } |
730 | 0 | size_t get_number_of_arguments() const override { return 3; } |
731 | | |
732 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
733 | 0 | uint32_t result, size_t input_rows_count) const override { |
734 | 0 | auto result_column = ColumnFloat64::create(input_rows_count); |
735 | 0 | auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); |
736 | |
|
737 | 0 | auto& result_data = result_column->get_data(); |
738 | 0 | NullMap& result_null_map = |
739 | 0 | assert_cast<ColumnUInt8*>(result_null_map_column.get())->get_data(); |
740 | |
|
741 | 0 | ColumnPtr argument_columns[3]; |
742 | 0 | bool col_const[3]; |
743 | 0 | size_t argument_size = arguments.size(); |
744 | 0 | for (int i = 0; i < argument_size; ++i) { |
745 | 0 | argument_columns[i] = block.get_by_position(arguments[i]).column; |
746 | 0 | col_const[i] = is_column_const(*argument_columns[i]); |
747 | 0 | if (col_const[i]) { |
748 | 0 | argument_columns[i] = |
749 | 0 | static_cast<const ColumnConst&>(*argument_columns[i]).get_data_column_ptr(); |
750 | 0 | } |
751 | 0 | } |
752 | |
|
753 | 0 | const auto* mean_col = assert_cast<const ColumnFloat64*>(argument_columns[0].get()); |
754 | 0 | const auto* sd_col = assert_cast<const ColumnFloat64*>(argument_columns[1].get()); |
755 | 0 | const auto* value_col = assert_cast<const ColumnFloat64*>(argument_columns[2].get()); |
756 | |
|
757 | 0 | result_column->reserve(input_rows_count); |
758 | 0 | for (size_t i = 0; i < input_rows_count; ++i) { |
759 | 0 | double mean = mean_col->get_element(index_check_const(i, col_const[0])); |
760 | 0 | double sd = sd_col->get_element(index_check_const(i, col_const[1])); |
761 | 0 | double v = value_col->get_element(index_check_const(i, col_const[2])); |
762 | |
|
763 | 0 | if (!check_argument(sd)) [[unlikely]] { |
764 | 0 | result_null_map[i] = true; |
765 | 0 | continue; |
766 | 0 | } |
767 | 0 | result_data[i] = calculate_cell(mean, sd, v); |
768 | 0 | } |
769 | |
|
770 | 0 | block.get_by_position(result).column = |
771 | 0 | ColumnNullable::create(std::move(result_column), std::move(result_null_map_column)); |
772 | 0 | return Status::OK(); |
773 | 0 | } |
774 | | |
775 | 0 | static bool check_argument(double sd) { return sd > 0; } |
776 | 0 | static double calculate_cell(double mean, double sd, double v) { |
777 | | #ifdef __APPLE__ |
778 | | const double sqrt2 = std::sqrt(2); |
779 | | #else |
780 | 0 | constexpr double sqrt2 = std::numbers::sqrt2; |
781 | 0 | #endif |
782 | |
|
783 | 0 | return 0.5 * (std::erf((v - mean) / (sd * sqrt2)) + 1); |
784 | 0 | } |
785 | | }; |
786 | | |
787 | | template <typename A> |
788 | | struct SignBitImpl { |
789 | | static constexpr PrimitiveType ResultType = TYPE_BOOLEAN; |
790 | | using DataType = typename PrimitiveTypeTraits<ResultType>::DataType; |
791 | 6 | static inline bool apply(A a) { return std::signbit(static_cast<Float64>(a)); } |
792 | | }; |
793 | | |
794 | | struct NameSignBit { |
795 | | static constexpr auto name = "signbit"; |
796 | | }; |
797 | | |
798 | | using FunctionSignBit = FunctionUnaryArithmetic<SignBitImpl<double>, NameSignBit, TYPE_DOUBLE>; |
799 | | |
800 | 9 | double EvenImpl(double a) { |
801 | 9 | double mag = std::abs(a); |
802 | 9 | double even_mag = 2 * std::ceil(mag / 2); |
803 | 9 | return std::copysign(even_mag, a); |
804 | 9 | } |
805 | | |
806 | | struct NameEven { |
807 | | static constexpr auto name = "even"; |
808 | | }; |
809 | | |
810 | | using FunctionEven = FunctionMathUnary<UnaryFunctionPlain<NameEven, EvenImpl>>; |
811 | | |
812 | | template <PrimitiveType A> |
813 | | struct GcdImpl { |
814 | | using cpp_type = typename PrimitiveTypeTraits<A>::CppType; |
815 | | |
816 | | static constexpr PrimitiveType type = A; |
817 | | static constexpr auto name = "gcd"; |
818 | | static constexpr bool need_replace_null_data_to_default = false; |
819 | | static constexpr bool is_nullable = false; |
820 | | |
821 | 5 | static DataTypes get_variadic_argument_types() { |
822 | 5 | using datatype = typename PrimitiveTypeTraits<A>::DataType; |
823 | 5 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; |
824 | 5 | } _ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE3EE27get_variadic_argument_typesEv Line | Count | Source | 821 | 1 | static DataTypes get_variadic_argument_types() { | 822 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 823 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 824 | 1 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE4EE27get_variadic_argument_typesEv Line | Count | Source | 821 | 1 | static DataTypes get_variadic_argument_types() { | 822 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 823 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 824 | 1 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE5EE27get_variadic_argument_typesEv Line | Count | Source | 821 | 1 | static DataTypes get_variadic_argument_types() { | 822 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 823 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 824 | 1 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE6EE27get_variadic_argument_typesEv Line | Count | Source | 821 | 1 | static DataTypes get_variadic_argument_types() { | 822 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 823 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 824 | 1 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE7EE27get_variadic_argument_typesEv Line | Count | Source | 821 | 1 | static DataTypes get_variadic_argument_types() { | 822 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 823 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 824 | 1 | } |
|
825 | | |
826 | 20 | static inline cpp_type apply(cpp_type a, cpp_type b) { |
827 | 20 | return static_cast<cpp_type>(std::gcd(a, b)); |
828 | 20 | } _ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE3EE5applyEaa Line | Count | Source | 826 | 6 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 827 | 6 | return static_cast<cpp_type>(std::gcd(a, b)); | 828 | 6 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE4EE5applyEss Line | Count | Source | 826 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 827 | 2 | return static_cast<cpp_type>(std::gcd(a, b)); | 828 | 2 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE5EE5applyEii Line | Count | Source | 826 | 8 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 827 | 8 | return static_cast<cpp_type>(std::gcd(a, b)); | 828 | 8 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE6EE5applyEll Line | Count | Source | 826 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 827 | 2 | return static_cast<cpp_type>(std::gcd(a, b)); | 828 | 2 | } |
_ZN5doris10vectorized7GcdImplILNS_13PrimitiveTypeE7EE5applyEnn Line | Count | Source | 826 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 827 | 2 | return static_cast<cpp_type>(std::gcd(a, b)); | 828 | 2 | } |
|
829 | | }; |
830 | | |
831 | | template <PrimitiveType A> |
832 | | struct LcmImpl { |
833 | | using cpp_type = typename PrimitiveTypeTraits<A>::CppType; |
834 | | |
835 | | static constexpr PrimitiveType type = A; |
836 | | static constexpr auto name = "lcm"; |
837 | | static constexpr bool need_replace_null_data_to_default = false; |
838 | | static constexpr bool is_nullable = false; |
839 | | |
840 | 4 | static DataTypes get_variadic_argument_types() { |
841 | 4 | using datatype = typename PrimitiveTypeTraits<A>::DataType; |
842 | 4 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; |
843 | 4 | } _ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE4EE27get_variadic_argument_typesEv Line | Count | Source | 840 | 1 | static DataTypes get_variadic_argument_types() { | 841 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 842 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 843 | 1 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE5EE27get_variadic_argument_typesEv Line | Count | Source | 840 | 1 | static DataTypes get_variadic_argument_types() { | 841 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 842 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 843 | 1 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE6EE27get_variadic_argument_typesEv Line | Count | Source | 840 | 1 | static DataTypes get_variadic_argument_types() { | 841 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 842 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 843 | 1 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE7EE27get_variadic_argument_typesEv Line | Count | Source | 840 | 1 | static DataTypes get_variadic_argument_types() { | 841 | 1 | using datatype = typename PrimitiveTypeTraits<A>::DataType; | 842 | 1 | return {std::make_shared<datatype>(), std::make_shared<datatype>()}; | 843 | 1 | } |
|
844 | | |
845 | 14 | static inline cpp_type apply(cpp_type a, cpp_type b) { |
846 | 14 | return static_cast<cpp_type>(std::lcm(a, b)); |
847 | 14 | } _ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE4EE5applyEss Line | Count | Source | 845 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 846 | 2 | return static_cast<cpp_type>(std::lcm(a, b)); | 847 | 2 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE5EE5applyEii Line | Count | Source | 845 | 8 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 846 | 8 | return static_cast<cpp_type>(std::lcm(a, b)); | 847 | 8 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE6EE5applyEll Line | Count | Source | 845 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 846 | 2 | return static_cast<cpp_type>(std::lcm(a, b)); | 847 | 2 | } |
_ZN5doris10vectorized7LcmImplILNS_13PrimitiveTypeE7EE5applyEnn Line | Count | Source | 845 | 2 | static inline cpp_type apply(cpp_type a, cpp_type b) { | 846 | 2 | return static_cast<cpp_type>(std::lcm(a, b)); | 847 | 2 | } |
|
848 | | }; |
849 | | |
850 | | enum class FloatPointNumberJudgmentType { |
851 | | IsNan = 0, |
852 | | IsInf, |
853 | | }; |
854 | | |
855 | | struct ImplIsNan { |
856 | | static constexpr auto name = "isnan"; |
857 | | static constexpr FloatPointNumberJudgmentType type = FloatPointNumberJudgmentType::IsNan; |
858 | | }; |
859 | | |
860 | | struct ImplIsInf { |
861 | | static constexpr auto name = "isinf"; |
862 | | static constexpr FloatPointNumberJudgmentType type = FloatPointNumberJudgmentType::IsInf; |
863 | | }; |
864 | | |
865 | | template <typename Impl> |
866 | | class FunctionFloatingPointNumberJudgment : public IFunction { |
867 | | public: |
868 | | using IFunction::execute; |
869 | | |
870 | | static constexpr auto name = Impl::name; |
871 | 8 | static FunctionPtr create() { return std::make_shared<FunctionFloatingPointNumberJudgment>(); }_ZN5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE6createEv Line | Count | Source | 871 | 4 | static FunctionPtr create() { return std::make_shared<FunctionFloatingPointNumberJudgment>(); } |
_ZN5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE6createEv Line | Count | Source | 871 | 4 | static FunctionPtr create() { return std::make_shared<FunctionFloatingPointNumberJudgment>(); } |
|
872 | | |
873 | | private: |
874 | 2 | String get_name() const override { return name; }_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE8get_nameB5cxx11Ev Line | Count | Source | 874 | 1 | String get_name() const override { return name; } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE8get_nameB5cxx11Ev Line | Count | Source | 874 | 1 | String get_name() const override { return name; } |
|
875 | 4 | size_t get_number_of_arguments() const override { return 1; }_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE23get_number_of_argumentsEv Line | Count | Source | 875 | 2 | size_t get_number_of_arguments() const override { return 1; } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE23get_number_of_argumentsEv Line | Count | Source | 875 | 2 | size_t get_number_of_arguments() const override { return 1; } |
|
876 | | |
877 | 4 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
878 | 4 | return std::make_shared<DataTypeBool>(); |
879 | 4 | } _ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaIS8_EE Line | Count | Source | 877 | 2 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 878 | 2 | return std::make_shared<DataTypeBool>(); | 879 | 2 | } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS0_9IDataTypeEESaIS8_EE Line | Count | Source | 877 | 2 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 878 | 2 | return std::make_shared<DataTypeBool>(); | 879 | 2 | } |
|
880 | | |
881 | | void execute_impl_with_type(const auto* input_column, |
882 | 4 | DataTypeBool::ColumnType::Container& output, size_t size) const { |
883 | 32 | for (int i = 0; i < size; i++) { |
884 | 28 | auto value = input_column->get_element(i); |
885 | 28 | if constexpr (Impl::type == FloatPointNumberJudgmentType::IsNan) { |
886 | 14 | output[i] = std::isnan(value); |
887 | 14 | } else if constexpr (Impl::type == FloatPointNumberJudgmentType::IsInf) { |
888 | 14 | output[i] = std::isinf(value); |
889 | 14 | } |
890 | 28 | } |
891 | 4 | } _ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE22execute_impl_with_typeINS0_12ColumnVectorILNS_13PrimitiveTypeE9EEEEEvPKT_RNS0_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEEm Line | Count | Source | 882 | 1 | DataTypeBool::ColumnType::Container& output, size_t size) const { | 883 | 8 | for (int i = 0; i < size; i++) { | 884 | 7 | auto value = input_column->get_element(i); | 885 | 7 | if constexpr (Impl::type == FloatPointNumberJudgmentType::IsNan) { | 886 | 7 | output[i] = std::isnan(value); | 887 | | } else if constexpr (Impl::type == FloatPointNumberJudgmentType::IsInf) { | 888 | | output[i] = std::isinf(value); | 889 | | } | 890 | 7 | } | 891 | 1 | } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE22execute_impl_with_typeINS0_12ColumnVectorILNS_13PrimitiveTypeE8EEEEEvPKT_RNS0_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEEm Line | Count | Source | 882 | 1 | DataTypeBool::ColumnType::Container& output, size_t size) const { | 883 | 8 | for (int i = 0; i < size; i++) { | 884 | 7 | auto value = input_column->get_element(i); | 885 | 7 | if constexpr (Impl::type == FloatPointNumberJudgmentType::IsNan) { | 886 | 7 | output[i] = std::isnan(value); | 887 | | } else if constexpr (Impl::type == FloatPointNumberJudgmentType::IsInf) { | 888 | | output[i] = std::isinf(value); | 889 | | } | 890 | 7 | } | 891 | 1 | } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE22execute_impl_with_typeINS0_12ColumnVectorILNS_13PrimitiveTypeE9EEEEEvPKT_RNS0_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEEm Line | Count | Source | 882 | 1 | DataTypeBool::ColumnType::Container& output, size_t size) const { | 883 | 8 | for (int i = 0; i < size; i++) { | 884 | 7 | auto value = input_column->get_element(i); | 885 | | if constexpr (Impl::type == FloatPointNumberJudgmentType::IsNan) { | 886 | | output[i] = std::isnan(value); | 887 | 7 | } else if constexpr (Impl::type == FloatPointNumberJudgmentType::IsInf) { | 888 | 7 | output[i] = std::isinf(value); | 889 | 7 | } | 890 | 7 | } | 891 | 1 | } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE22execute_impl_with_typeINS0_12ColumnVectorILNS_13PrimitiveTypeE8EEEEEvPKT_RNS0_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEEm Line | Count | Source | 882 | 1 | DataTypeBool::ColumnType::Container& output, size_t size) const { | 883 | 8 | for (int i = 0; i < size; i++) { | 884 | 7 | auto value = input_column->get_element(i); | 885 | | if constexpr (Impl::type == FloatPointNumberJudgmentType::IsNan) { | 886 | | output[i] = std::isnan(value); | 887 | 7 | } else if constexpr (Impl::type == FloatPointNumberJudgmentType::IsInf) { | 888 | 7 | output[i] = std::isinf(value); | 889 | 7 | } | 890 | 7 | } | 891 | 1 | } |
|
892 | | |
893 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
894 | 4 | uint32_t result, size_t input_rows_count) const override { |
895 | 4 | auto dst = DataTypeBool::ColumnType::create(); |
896 | 4 | auto& dst_data = dst->get_data(); |
897 | 4 | dst_data.resize(input_rows_count); |
898 | 4 | const auto* column = block.get_by_position(arguments[0]).column.get(); |
899 | 4 | if (const auto* col_f64 = check_and_get_column<ColumnFloat64>(column)) { |
900 | 2 | execute_impl_with_type(col_f64, dst_data, input_rows_count); |
901 | 2 | } else if (const auto* col_f32 = check_and_get_column<ColumnFloat32>(column)) { |
902 | 2 | execute_impl_with_type(col_f32, dst_data, input_rows_count); |
903 | 2 | } else { |
904 | 0 | return Status::InvalidArgument("Unsupported column type {} for function {}", |
905 | 0 | column->get_name(), get_name()); |
906 | 0 | } |
907 | 4 | block.replace_by_position(result, std::move(dst)); |
908 | 4 | return Status::OK(); |
909 | 4 | } _ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsNanEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 894 | 2 | uint32_t result, size_t input_rows_count) const override { | 895 | 2 | auto dst = DataTypeBool::ColumnType::create(); | 896 | 2 | auto& dst_data = dst->get_data(); | 897 | 2 | dst_data.resize(input_rows_count); | 898 | 2 | const auto* column = block.get_by_position(arguments[0]).column.get(); | 899 | 2 | if (const auto* col_f64 = check_and_get_column<ColumnFloat64>(column)) { | 900 | 1 | execute_impl_with_type(col_f64, dst_data, input_rows_count); | 901 | 1 | } else if (const auto* col_f32 = check_and_get_column<ColumnFloat32>(column)) { | 902 | 1 | execute_impl_with_type(col_f32, dst_data, input_rows_count); | 903 | 1 | } else { | 904 | 0 | return Status::InvalidArgument("Unsupported column type {} for function {}", | 905 | 0 | column->get_name(), get_name()); | 906 | 0 | } | 907 | 2 | block.replace_by_position(result, std::move(dst)); | 908 | 2 | return Status::OK(); | 909 | 2 | } |
_ZNK5doris10vectorized35FunctionFloatingPointNumberJudgmentINS0_9ImplIsInfEE12execute_implEPNS_15FunctionContextERNS0_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 894 | 2 | uint32_t result, size_t input_rows_count) const override { | 895 | 2 | auto dst = DataTypeBool::ColumnType::create(); | 896 | 2 | auto& dst_data = dst->get_data(); | 897 | 2 | dst_data.resize(input_rows_count); | 898 | 2 | const auto* column = block.get_by_position(arguments[0]).column.get(); | 899 | 2 | if (const auto* col_f64 = check_and_get_column<ColumnFloat64>(column)) { | 900 | 1 | execute_impl_with_type(col_f64, dst_data, input_rows_count); | 901 | 1 | } else if (const auto* col_f32 = check_and_get_column<ColumnFloat32>(column)) { | 902 | 1 | execute_impl_with_type(col_f32, dst_data, input_rows_count); | 903 | 1 | } else { | 904 | 0 | return Status::InvalidArgument("Unsupported column type {} for function {}", | 905 | 0 | column->get_name(), get_name()); | 906 | 0 | } | 907 | 2 | block.replace_by_position(result, std::move(dst)); | 908 | 2 | return Status::OK(); | 909 | 2 | } |
|
910 | | }; |
911 | | |
912 | | using FunctionIsNan = FunctionFloatingPointNumberJudgment<ImplIsNan>; |
913 | | using FunctionIsInf = FunctionFloatingPointNumberJudgment<ImplIsInf>; |
914 | | |
915 | 1 | void register_function_math(SimpleFunctionFactory& factory) { |
916 | 1 | factory.register_function<FunctionAcos>(); |
917 | 1 | factory.register_function<FunctionAcosh>(); |
918 | 1 | factory.register_function<FunctionAsin>(); |
919 | 1 | factory.register_function<FunctionAsinh>(); |
920 | 1 | factory.register_function<FunctionAtan>(); |
921 | 1 | factory.register_function<FunctionAtanh>(); |
922 | 1 | factory.register_function<FunctionMathBinary<LogImpl>>(); |
923 | 1 | factory.register_function<FunctionMathBinary<PowImpl>>(); |
924 | 1 | factory.register_function<FunctionMathBinary<Atan2Impl>>(); |
925 | 1 | factory.register_function<FunctionCos>(); |
926 | 1 | factory.register_function<FunctionCosh>(); |
927 | 1 | factory.register_function<FunctionE>(); |
928 | 1 | factory.register_alias("ln", "dlog1"); |
929 | 1 | factory.register_function<FunctionMathLog<ImplLn>>(); |
930 | 1 | factory.register_function<FunctionMathLog<ImplLog2>>(); |
931 | 1 | factory.register_function<FunctionMathLog<ImplLog10>>(); |
932 | 1 | factory.register_alias("log10", "dlog10"); |
933 | 1 | factory.register_function<FunctionPi>(); |
934 | 1 | factory.register_function<FunctionSign>(); |
935 | 1 | factory.register_function<FunctionAbsInt8>(); |
936 | 1 | factory.register_function<FunctionAbsInt16>(); |
937 | 1 | factory.register_function<FunctionAbsInt32>(); |
938 | 1 | factory.register_function<FunctionAbsInt64>(); |
939 | 1 | factory.register_function<FunctionAbsInt128>(); |
940 | 1 | factory.register_function<FunctionAbsUInt8>(); |
941 | 1 | factory.register_function<FunctionAbsDecimal32>(); |
942 | 1 | factory.register_function<FunctionAbsDecimal64>(); |
943 | 1 | factory.register_function<FunctionAbsDecimalV3>(); |
944 | 1 | factory.register_function<FunctionAbsDecimalV2>(); |
945 | 1 | factory.register_function<FunctionAbsDecimal256>(); |
946 | 1 | factory.register_function<FunctionAbsFloat>(); |
947 | 1 | factory.register_function<FunctionAbsDouble>(); |
948 | 1 | factory.register_function<FunctionNegativeDouble>(); |
949 | 1 | factory.register_function<FunctionNegativeBigInt>(); |
950 | 1 | factory.register_function<FunctionNegativeDecimalV2>(); |
951 | 1 | factory.register_function<FunctionNegativeDecimal256>(); |
952 | 1 | factory.register_function<FunctionNegativeDecimalV3>(); |
953 | 1 | factory.register_function<FunctionNegativeDecimal32>(); |
954 | 1 | factory.register_function<FunctionNegativeDecimal64>(); |
955 | | |
956 | 1 | factory.register_function<FunctionPositiveDecimal32>(); |
957 | 1 | factory.register_function<FunctionPositiveDecimal64>(); |
958 | 1 | factory.register_function<FunctionPositiveDecimalV3>(); |
959 | 1 | factory.register_function<FunctionPositiveDecimalV2>(); |
960 | 1 | factory.register_function<FunctionPositiveDecimal256>(); |
961 | 1 | factory.register_function<FunctionPositiveDouble>(); |
962 | 1 | factory.register_function<FunctionPositiveBigInt>(); |
963 | | |
964 | 1 | factory.register_function<FunctionSin>(); |
965 | 1 | factory.register_function<FunctionSinh>(); |
966 | 1 | factory.register_function<FunctionSqrt>(); |
967 | 1 | factory.register_alias("sqrt", "dsqrt"); |
968 | 1 | factory.register_function<FunctionCbrt>(); |
969 | 1 | factory.register_function<FunctionTan>(); |
970 | 1 | factory.register_function<FunctionTanh>(); |
971 | 1 | factory.register_function<FunctionCot>(); |
972 | 1 | factory.register_function<FunctionSec>(); |
973 | 1 | factory.register_function<FunctionCosec>(); |
974 | 1 | factory.register_alias("pow", "power"); |
975 | 1 | factory.register_alias("pow", "dpow"); |
976 | 1 | factory.register_alias("pow", "fpow"); |
977 | 1 | factory.register_function<FunctionExp>(); |
978 | 1 | factory.register_alias("exp", "dexp"); |
979 | 1 | factory.register_function<FunctionFactorial>(); |
980 | 1 | factory.register_function<FunctionRadians>(); |
981 | 1 | factory.register_function<FunctionDegrees>(); |
982 | 1 | factory.register_function<FunctionBin>(); |
983 | 1 | factory.register_function<FunctionNormalCdf>(); |
984 | 1 | factory.register_function<FunctionSignBit>(); |
985 | 1 | factory.register_function<FunctionEven>(); |
986 | 1 | factory.register_function<FunctionMathBinary<GcdImpl<TYPE_TINYINT>>>(); |
987 | 1 | factory.register_function<FunctionMathBinary<GcdImpl<TYPE_SMALLINT>>>(); |
988 | 1 | factory.register_function<FunctionMathBinary<GcdImpl<TYPE_INT>>>(); |
989 | 1 | factory.register_function<FunctionMathBinary<GcdImpl<TYPE_BIGINT>>>(); |
990 | 1 | factory.register_function<FunctionMathBinary<GcdImpl<TYPE_LARGEINT>>>(); |
991 | 1 | factory.register_function<FunctionMathBinary<LcmImpl<TYPE_SMALLINT>>>(); |
992 | 1 | factory.register_function<FunctionMathBinary<LcmImpl<TYPE_INT>>>(); |
993 | 1 | factory.register_function<FunctionMathBinary<LcmImpl<TYPE_BIGINT>>>(); |
994 | 1 | factory.register_function<FunctionMathBinary<LcmImpl<TYPE_LARGEINT>>>(); |
995 | 1 | factory.register_function<FunctionIsNan>(); |
996 | 1 | factory.register_function<FunctionIsInf>(); |
997 | 1 | } |
998 | | } // namespace doris::vectorized |