/root/doris/be/src/vec/functions/modulo.cpp
Line | Count | Source (jump to first uncovered line) |
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 | | // This file is copied from |
18 | | // https://github.com/ClickHouse/ClickHouse/blob/master/src/Functions/Modulo.cpp |
19 | | // and modified by Doris |
20 | | |
21 | | #include <string.h> |
22 | | |
23 | | #include <cmath> |
24 | | #include <memory> |
25 | | #include <utility> |
26 | | |
27 | | #include "runtime/decimalv2_value.h" |
28 | | #include "vec/columns/column_vector.h" |
29 | | #include "vec/core/types.h" |
30 | | #include "vec/data_types/number_traits.h" |
31 | | #include "vec/functions/function_binary_arithmetic.h" |
32 | | #include "vec/functions/simple_function_factory.h" |
33 | | |
34 | | namespace doris::vectorized { |
35 | | |
36 | | template <typename A, typename B> |
37 | 4 | inline void throw_if_division_leads_to_FPE(A a, B b) { |
38 | | // http://avva.livejournal.com/2548306.html |
39 | | // (-9223372036854775808 % -1) will cause coredump directly, so check this case to throw exception, or maybe could return 0 as result |
40 | 4 | if constexpr (std::is_signed_v<A> && std::is_signed_v<B>) { |
41 | 4 | if (b == -1 && a == std::numeric_limits<A>::min()) { |
42 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, |
43 | 0 | "Division of minimal signed number by minus one is an undefined " |
44 | 0 | "behavior, {} % {}. ", |
45 | 0 | a, b); |
46 | 0 | } |
47 | 4 | } |
48 | 4 | } Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIhhEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIhaEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIhsEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIhiEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIhlEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIhnEEvT_T0_ _ZN5doris10vectorized30throw_if_division_leads_to_FPEIiiEEvT_T0_ Line | Count | Source | 37 | 4 | inline void throw_if_division_leads_to_FPE(A a, B b) { | 38 | | // http://avva.livejournal.com/2548306.html | 39 | | // (-9223372036854775808 % -1) will cause coredump directly, so check this case to throw exception, or maybe could return 0 as result | 40 | 4 | if constexpr (std::is_signed_v<A> && std::is_signed_v<B>) { | 41 | 4 | if (b == -1 && a == std::numeric_limits<A>::min()) { | 42 | 0 | throw Exception(ErrorCode::INVALID_ARGUMENT, | 43 | 0 | "Division of minimal signed number by minus one is an undefined " | 44 | 0 | "behavior, {} % {}. ", | 45 | 0 | a, b); | 46 | 0 | } | 47 | 4 | } | 48 | 4 | } |
Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIllEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEInnEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIN4wide7integerILm256EiEES4_EEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIahEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIaaEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIasEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIaiEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIalEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIanEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIshEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIsaEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIssEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIsiEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIslEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIsnEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIihEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIiaEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIisEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIilEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIinEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIlhEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIlaEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIlsEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIliEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIlnEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEInhEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEInaEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEInsEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEIniEEvT_T0_ Unexecuted instantiation: _ZN5doris10vectorized30throw_if_division_leads_to_FPEInlEEvT_T0_ |
49 | | |
50 | | template <typename A, typename B> |
51 | | struct ModuloImpl { |
52 | | using ResultType = typename NumberTraits::ResultOfModulo<A, B>::Type; |
53 | | using Traits = NumberTraits::BinaryOperatorTraits<A, B>; |
54 | | |
55 | | template <typename Result = ResultType> |
56 | | static void apply(const typename Traits::ArrayA& a, B b, |
57 | | typename ColumnVector<Result>::Container& c, |
58 | 0 | typename Traits::ArrayNull& null_map) { |
59 | 0 | size_t size = c.size(); |
60 | 0 | UInt8 is_null = b == 0; |
61 | 0 | memset(null_map.data(), is_null, sizeof(UInt8) * size); |
62 | |
|
63 | 0 | if (!is_null) { |
64 | 0 | for (size_t i = 0; i < size; i++) { |
65 | 0 | if constexpr (std::is_floating_point_v<ResultType>) { |
66 | 0 | c[i] = std::fmod((double)a[i], (double)b); |
67 | 0 | } else { |
68 | 0 | throw_if_division_leads_to_FPE(a[i], b); |
69 | 0 | c[i] = a[i] % b; |
70 | 0 | } |
71 | 0 | } |
72 | 0 | } |
73 | 0 | } Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhhE5applyIsEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhaE5applyIaEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhsE5applyIsEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhiE5applyIiEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhlE5applyIlEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhnE5applyInEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhfE5applyIfEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhdE5applyIdEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIahE5applyIaEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIaaE5applyIaEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIasE5applyIsEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIaiE5applyIiEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIalE5applyIlEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIanE5applyInEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIafE5applyIfEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIadE5applyIdEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIshE5applyIsEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIsaE5applyIsEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIssE5applyIsEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIsiE5applyIiEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIslE5applyIlEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIsnE5applyInEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIsfE5applyIfEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIsdE5applyIdEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIihE5applyIiEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIiaE5applyIiEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIisE5applyIiEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIiiE5applyIiEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIilE5applyIlEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIinE5applyInEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIifE5applyIfEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIidE5applyIdEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIlhE5applyIlEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIlaE5applyIlEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIlsE5applyIlEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIliE5applyIlEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIllE5applyIlEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIlnE5applyInEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIlfE5applyIfEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIldE5applyIdEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInhE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInaE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInsE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIniE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInlE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInnE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInfE5applyIfEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIndE5applyIdEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfhE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfaE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfsE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfiE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIflE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfnE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIffE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfdE5applyIdEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdhE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdaE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdsE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdiE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdlE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdnE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdfE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIddE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE |
74 | | |
75 | | template <typename Result = ResultType> |
76 | 4 | static inline Result apply(A a, B b, UInt8& is_null) { |
77 | 4 | is_null = b == 0; |
78 | 4 | b += is_null; |
79 | | |
80 | 4 | if constexpr (std::is_floating_point_v<Result>) { |
81 | 4 | return std::fmod((double)a, (double)b); |
82 | 4 | } else { |
83 | 4 | throw_if_division_leads_to_FPE(a, b); |
84 | 4 | return a % b; |
85 | 4 | } |
86 | 4 | } Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhhE5applyIsEET_hhRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhaE5applyIaEET_haRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhsE5applyIsEET_hsRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhiE5applyIiEET_hiRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhlE5applyIlEET_hlRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhnE5applyInEET_hnRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhfE5applyIfEET_hfRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIhdE5applyIdEET_hdRh _ZN5doris10vectorized10ModuloImplIiiE5applyIiEET_iiRh Line | Count | Source | 76 | 4 | static inline Result apply(A a, B b, UInt8& is_null) { | 77 | 4 | is_null = b == 0; | 78 | 4 | b += is_null; | 79 | | | 80 | 4 | if constexpr (std::is_floating_point_v<Result>) { | 81 | 4 | return std::fmod((double)a, (double)b); | 82 | 4 | } else { | 83 | 4 | throw_if_division_leads_to_FPE(a, b); | 84 | 4 | return a % b; | 85 | 4 | } | 86 | 4 | } |
Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIllE5applyIlEET_llRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInnE5applyInEET_nnRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIN4wide7integerILm256EiEES4_E5applyIS4_EET_S4_S4_Rh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIahE5applyIaEET_ahRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIaaE5applyIaEET_aaRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIasE5applyIsEET_asRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIaiE5applyIiEET_aiRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIalE5applyIlEET_alRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIanE5applyInEET_anRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIafE5applyIfEET_afRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIadE5applyIdEET_adRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIshE5applyIsEET_shRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIsaE5applyIsEET_saRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIssE5applyIsEET_ssRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIsiE5applyIiEET_siRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIslE5applyIlEET_slRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIsnE5applyInEET_snRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIsfE5applyIfEET_sfRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIsdE5applyIdEET_sdRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIihE5applyIiEET_ihRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIiaE5applyIiEET_iaRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIisE5applyIiEET_isRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIilE5applyIlEET_ilRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIinE5applyInEET_inRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIifE5applyIfEET_ifRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIidE5applyIdEET_idRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIlhE5applyIlEET_lhRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIlaE5applyIlEET_laRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIlsE5applyIlEET_lsRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIliE5applyIlEET_liRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIlnE5applyInEET_lnRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIlfE5applyIfEET_lfRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIldE5applyIdEET_ldRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInhE5applyInEET_nhRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInaE5applyInEET_naRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInsE5applyInEET_nsRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIniE5applyInEET_niRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInlE5applyInEET_nlRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInfE5applyIfEET_nfRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIndE5applyIdEET_ndRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfhE5applyIfEET_fhRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfaE5applyIfEET_faRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfsE5applyIfEET_fsRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfiE5applyIfEET_fiRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIflE5applyIfEET_flRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfnE5applyIfEET_fnRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIffE5applyIfEET_ffRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIfdE5applyIdEET_fdRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdhE5applyIdEET_dhRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdaE5applyIdEET_daRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdsE5applyIdEET_dsRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdiE5applyIdEET_diRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdlE5applyIdEET_dlRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdnE5applyIdEET_dnRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIdfE5applyIdEET_dfRh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIddE5applyIdEET_ddRh |
87 | | |
88 | | template <typename Result = DecimalV2Value> |
89 | 0 | static inline DecimalV2Value apply(DecimalV2Value a, DecimalV2Value b, UInt8& is_null) { |
90 | 0 | is_null = b == DecimalV2Value(0); |
91 | 0 | return a % (b + DecimalV2Value(is_null)); |
92 | 0 | } Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIiiE5applyINS_14DecimalV2ValueEEES4_S4_S4_Rh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIllE5applyINS_14DecimalV2ValueEEES4_S4_S4_Rh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplInnE5applyINS_14DecimalV2ValueEEES4_S4_S4_Rh Unexecuted instantiation: _ZN5doris10vectorized10ModuloImplIN4wide7integerILm256EiEES4_E5applyINS_14DecimalV2ValueEEES7_S7_S7_Rh |
93 | | }; |
94 | | |
95 | | template <typename A, typename B> |
96 | | struct PModuloImpl { |
97 | | using ResultType = typename NumberTraits::ResultOfModulo<A, B>::Type; |
98 | | using Traits = NumberTraits::BinaryOperatorTraits<A, B>; |
99 | | |
100 | | template <typename Result = ResultType> |
101 | | static void apply(const typename Traits::ArrayA& a, B b, |
102 | | typename ColumnVector<Result>::Container& c, |
103 | 0 | typename Traits::ArrayNull& null_map) { |
104 | 0 | size_t size = c.size(); |
105 | 0 | UInt8 is_null = b == 0; |
106 | 0 | memset(null_map.data(), is_null, size); |
107 | |
|
108 | 0 | if (!is_null) { |
109 | 0 | for (size_t i = 0; i < size; i++) { |
110 | 0 | if constexpr (std::is_floating_point_v<ResultType>) { |
111 | 0 | c[i] = std::fmod(std::fmod((double)a[i], (double)b) + (double)b, double(b)); |
112 | 0 | } else { |
113 | 0 | throw_if_division_leads_to_FPE(a[i], b); |
114 | 0 | c[i] = (a[i] % b + b) % b; |
115 | 0 | } |
116 | 0 | } |
117 | 0 | } |
118 | 0 | } Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhhE5applyIsEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhaE5applyIaEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhsE5applyIsEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhiE5applyIiEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhlE5applyIlEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhnE5applyInEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhfE5applyIfEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhdE5applyIdEEvRKNS0_8PODArrayIhLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERS8_ Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIahE5applyIaEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIaaE5applyIaEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIasE5applyIsEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIaiE5applyIiEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIalE5applyIlEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIanE5applyInEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIafE5applyIfEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIadE5applyIdEEvRKNS0_8PODArrayIaLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIshE5applyIsEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIsaE5applyIsEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIssE5applyIsEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIsiE5applyIiEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIslE5applyIlEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIsnE5applyInEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIsfE5applyIfEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIsdE5applyIdEEvRKNS0_8PODArrayIsLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIihE5applyIiEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIiaE5applyIiEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIisE5applyIiEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIiiE5applyIiEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIilE5applyIlEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIinE5applyInEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIifE5applyIfEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIidE5applyIdEEvRKNS0_8PODArrayIiLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIlhE5applyIlEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIlaE5applyIlEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIlsE5applyIlEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIliE5applyIlEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIllE5applyIlEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIlnE5applyInEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIlfE5applyIfEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIldE5applyIdEEvRKNS0_8PODArrayIlLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInhE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInaE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInsE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIniE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInlE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInnE5applyInEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInfE5applyIfEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIndE5applyIdEEvRKNS0_8PODArrayInLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfhE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfaE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfsE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfiE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIflE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfnE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIffE5applyIfEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfdE5applyIdEEvRKNS0_8PODArrayIfLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdhE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEhRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdaE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEaRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdsE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEsRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdiE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEiRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdlE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEElRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdnE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEnRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdfE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEfRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIddE5applyIdEEvRKNS0_8PODArrayIdLm4096E9AllocatorILb0ELb0ELb0E22DefaultMemoryAllocatorELm16ELm15EEEdRNS0_12ColumnVectorIT_E9ContainerERNS4_IhLm4096ES7_Lm16ELm15EEE |
119 | | |
120 | | template <typename Result = ResultType> |
121 | 0 | static inline Result apply(A a, B b, UInt8& is_null) { |
122 | 0 | is_null = b == 0; |
123 | 0 | b += is_null; |
124 | |
|
125 | 0 | if constexpr (std::is_floating_point_v<Result>) { |
126 | 0 | return std::fmod(std::fmod((double)a, (double)b) + (double)b, (double)b); |
127 | 0 | } else { |
128 | 0 | throw_if_division_leads_to_FPE(a, b); |
129 | 0 | return (a % b + b) % b; |
130 | 0 | } |
131 | 0 | } Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhhE5applyIsEET_hhRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhaE5applyIaEET_haRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhsE5applyIsEET_hsRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhiE5applyIiEET_hiRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhlE5applyIlEET_hlRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhnE5applyInEET_hnRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhfE5applyIfEET_hfRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIhdE5applyIdEET_hdRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIahE5applyIaEET_ahRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIaaE5applyIaEET_aaRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIasE5applyIsEET_asRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIaiE5applyIiEET_aiRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIalE5applyIlEET_alRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIanE5applyInEET_anRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIafE5applyIfEET_afRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIadE5applyIdEET_adRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIshE5applyIsEET_shRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIsaE5applyIsEET_saRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIssE5applyIsEET_ssRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIsiE5applyIiEET_siRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIslE5applyIlEET_slRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIsnE5applyInEET_snRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIsfE5applyIfEET_sfRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIsdE5applyIdEET_sdRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIihE5applyIiEET_ihRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIiaE5applyIiEET_iaRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIisE5applyIiEET_isRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIiiE5applyIiEET_iiRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIilE5applyIlEET_ilRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIinE5applyInEET_inRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIifE5applyIfEET_ifRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIidE5applyIdEET_idRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIlhE5applyIlEET_lhRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIlaE5applyIlEET_laRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIlsE5applyIlEET_lsRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIliE5applyIlEET_liRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIllE5applyIlEET_llRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIlnE5applyInEET_lnRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIlfE5applyIfEET_lfRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIldE5applyIdEET_ldRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInhE5applyInEET_nhRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInaE5applyInEET_naRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInsE5applyInEET_nsRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIniE5applyInEET_niRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInlE5applyInEET_nlRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInnE5applyInEET_nnRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplInfE5applyIfEET_nfRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIndE5applyIdEET_ndRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfhE5applyIfEET_fhRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfaE5applyIfEET_faRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfsE5applyIfEET_fsRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfiE5applyIfEET_fiRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIflE5applyIfEET_flRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfnE5applyIfEET_fnRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIffE5applyIfEET_ffRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIfdE5applyIdEET_fdRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdhE5applyIdEET_dhRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdaE5applyIdEET_daRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdsE5applyIdEET_dsRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdiE5applyIdEET_diRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdlE5applyIdEET_dlRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdnE5applyIdEET_dnRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIdfE5applyIdEET_dfRh Unexecuted instantiation: _ZN5doris10vectorized11PModuloImplIddE5applyIdEET_ddRh |
132 | | |
133 | | template <typename Result = DecimalV2Value> |
134 | | static inline DecimalV2Value apply(DecimalV2Value a, DecimalV2Value b, UInt8& is_null) { |
135 | | is_null = b == DecimalV2Value(0); |
136 | | b += DecimalV2Value(is_null); |
137 | | return (a % b + b) % b; |
138 | | } |
139 | | }; |
140 | | |
141 | | struct NameModulo { |
142 | | static constexpr auto name = "mod"; |
143 | | }; |
144 | | struct NamePModulo { |
145 | | static constexpr auto name = "pmod"; |
146 | | }; |
147 | | |
148 | | using FunctionModulo = FunctionBinaryArithmetic<ModuloImpl, NameModulo, true>; |
149 | | using FunctionPModulo = FunctionBinaryArithmetic<PModuloImpl, NamePModulo, true>; |
150 | | |
151 | 1 | void register_function_modulo(SimpleFunctionFactory& factory) { |
152 | 1 | factory.register_function<FunctionModulo>(); |
153 | 1 | factory.register_function<FunctionPModulo>(); |
154 | 1 | factory.register_alias("mod", "fmod"); |
155 | 1 | } |
156 | | |
157 | | } // namespace doris::vectorized |