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