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