Coverage Report

Created: 2026-03-15 01:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/core/accurate_comparison.h
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
// This file is copied from
18
// https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/AccurateComparison.h
19
// and modified by Doris
20
21
#pragma once
22
23
#include "common/compare.h"
24
#include "core/data_type/primitive_type.h"
25
#include "core/string_ref.h"
26
#include "core/types.h"
27
namespace doris {
28
29
template <PrimitiveType PT>
30
struct CompareType {
31
    using NativeType = typename PrimitiveTypeTraits<PT>::CppType;
32
};
33
34
template <>
35
struct CompareType<TYPE_DECIMAL32> {
36
    using NativeType = typename PrimitiveTypeTraits<TYPE_DECIMAL32>::CppType::NativeType;
37
};
38
template <>
39
struct CompareType<TYPE_DECIMAL64> {
40
    using NativeType = typename PrimitiveTypeTraits<TYPE_DECIMAL64>::CppType::NativeType;
41
};
42
template <>
43
struct CompareType<TYPE_DECIMAL128I> {
44
    using NativeType = typename PrimitiveTypeTraits<TYPE_DECIMAL128I>::CppType::NativeType;
45
};
46
template <>
47
struct CompareType<TYPE_DECIMALV2> {
48
    using NativeType = typename PrimitiveTypeTraits<TYPE_DECIMALV2>::CppType::NativeType;
49
};
50
template <>
51
struct CompareType<TYPE_DECIMAL256> {
52
    using NativeType = typename PrimitiveTypeTraits<TYPE_DECIMAL256>::CppType::NativeType;
53
};
54
55
template <PrimitiveType PT>
56
struct EqualsOp {
57
    /// An operation that gives the same result, if arguments are passed in reverse order.
58
    using SymmetricOp = EqualsOp<PT>;
59
    using NativeType = typename CompareType<PT>::NativeType;
60
61
70.5k
    static UInt8 apply(NativeType a, NativeType b) { return Compare::equal(a, b); }
_ZN5doris8EqualsOpILNS_13PrimitiveTypeE5EE5applyEii
Line
Count
Source
61
70.5k
    static UInt8 apply(NativeType a, NativeType b) { return Compare::equal(a, b); }
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE2EE5applyEhh
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE3EE5applyEaa
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE4EE5applyEss
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE6EE5applyEll
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE7EE5applyEnn
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE36EE5applyEjj
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE37EE5applyEoo
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE8EE5applyEff
_ZN5doris8EqualsOpILNS_13PrimitiveTypeE9EE5applyEdd
Line
Count
Source
61
3
    static UInt8 apply(NativeType a, NativeType b) { return Compare::equal(a, b); }
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE27EE5applyEdd
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE35EE5applyEN4wide7integerILm256EiEES5_
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE28EE5applyEii
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE29EE5applyEll
Unexecuted instantiation: _ZN5doris8EqualsOpILNS_13PrimitiveTypeE30EE5applyEnn
62
};
63
64
template <>
65
struct EqualsOp<TYPE_DECIMALV2> {
66
0
    static UInt8 apply(const Int128& a, const Int128& b) { return a == b; }
67
};
68
69
template <>
70
struct EqualsOp<TYPE_DATE> {
71
    using SymmetricOp = EqualsOp<TYPE_DATE>;
72
    using NativeType = typename CompareType<TYPE_DATE>::NativeType;
73
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a == b; }
74
};
75
76
template <>
77
struct EqualsOp<TYPE_DATETIME> {
78
    using SymmetricOp = EqualsOp<TYPE_DATETIME>;
79
    using NativeType = typename CompareType<TYPE_DATETIME>::NativeType;
80
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a == b; }
81
};
82
83
template <>
84
struct EqualsOp<TYPE_DATEV2> {
85
    using SymmetricOp = EqualsOp<TYPE_DATEV2>;
86
    using NativeType = typename CompareType<TYPE_DATEV2>::NativeType;
87
    static UInt8 apply(const DateV2Value<DateV2ValueType>& a,
88
0
                       const DateV2Value<DateV2ValueType>& b) {
89
0
        return a == b;
90
0
    }
91
};
92
93
template <>
94
struct EqualsOp<TYPE_DATETIMEV2> {
95
    using SymmetricOp = EqualsOp<TYPE_DATETIMEV2>;
96
    using NativeType = typename CompareType<TYPE_DATETIMEV2>::NativeType;
97
    static UInt8 apply(const DateV2Value<DateTimeV2ValueType>& a,
98
0
                       const DateV2Value<DateTimeV2ValueType>& b) {
99
0
        return a == b;
100
0
    }
101
};
102
103
template <>
104
struct EqualsOp<TYPE_TIMESTAMPTZ> {
105
    using SymmetricOp = EqualsOp<TYPE_TIMESTAMPTZ>;
106
    using NativeType = typename CompareType<TYPE_TIMESTAMPTZ>::NativeType;
107
0
    static UInt8 apply(const TimestampTzValue& a, const TimestampTzValue& b) { return a == b; }
108
};
109
110
template <>
111
struct EqualsOp<TYPE_STRING> {
112
0
    static UInt8 apply(const StringRef& a, const StringRef& b) { return a == b; }
113
};
114
115
template <PrimitiveType PT>
116
struct NotEqualsOp {
117
    using SymmetricOp = NotEqualsOp<PT>;
118
    using NativeType = typename CompareType<PT>::NativeType;
119
2
    static UInt8 apply(NativeType a, NativeType b) { return Compare::not_equal(a, b); }
_ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE5EE5applyEii
Line
Count
Source
119
2
    static UInt8 apply(NativeType a, NativeType b) { return Compare::not_equal(a, b); }
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE2EE5applyEhh
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE3EE5applyEaa
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE4EE5applyEss
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE6EE5applyEll
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE7EE5applyEnn
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE36EE5applyEjj
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE37EE5applyEoo
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE8EE5applyEff
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE9EE5applyEdd
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE27EE5applyEdd
Unexecuted instantiation: _ZN5doris11NotEqualsOpILNS_13PrimitiveTypeE35EE5applyEN4wide7integerILm256EiEES5_
120
};
121
122
template <>
123
struct NotEqualsOp<TYPE_DECIMALV2> {
124
0
    static UInt8 apply(const DecimalV2Value& a, const DecimalV2Value& b) { return a != b; }
125
};
126
127
template <>
128
struct NotEqualsOp<TYPE_DATE> {
129
    using SymmetricOp = NotEqualsOp<TYPE_DATE>;
130
    using NativeType = typename CompareType<TYPE_DATE>::NativeType;
131
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a != b; }
132
};
133
134
template <>
135
struct NotEqualsOp<TYPE_DATETIME> {
136
    using SymmetricOp = NotEqualsOp<TYPE_DATETIME>;
137
    using NativeType = typename CompareType<TYPE_DATETIME>::NativeType;
138
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a != b; }
139
};
140
141
template <>
142
struct NotEqualsOp<TYPE_DATEV2> {
143
    using SymmetricOp = NotEqualsOp<TYPE_DATEV2>;
144
    using NativeType = typename CompareType<TYPE_DATEV2>::NativeType;
145
    static UInt8 apply(const DateV2Value<DateV2ValueType>& a,
146
0
                       const DateV2Value<DateV2ValueType>& b) {
147
0
        return a != b;
148
0
    }
149
};
150
151
template <>
152
struct NotEqualsOp<TYPE_DATETIMEV2> {
153
    using SymmetricOp = NotEqualsOp<TYPE_DATETIMEV2>;
154
    using NativeType = typename CompareType<TYPE_DATETIMEV2>::NativeType;
155
    static UInt8 apply(const DateV2Value<DateTimeV2ValueType>& a,
156
0
                       const DateV2Value<DateTimeV2ValueType>& b) {
157
0
        return a != b;
158
0
    }
159
};
160
161
template <>
162
struct NotEqualsOp<TYPE_TIMESTAMPTZ> {
163
    using SymmetricOp = NotEqualsOp<TYPE_TIMESTAMPTZ>;
164
    using NativeType = typename CompareType<TYPE_TIMESTAMPTZ>::NativeType;
165
0
    static UInt8 apply(const TimestampTzValue& a, const TimestampTzValue& b) { return a != b; }
166
};
167
168
template <PrimitiveType PT>
169
struct GreaterOp;
170
171
template <PrimitiveType PT>
172
struct LessOp {
173
    using SymmetricOp = GreaterOp<PT>;
174
    using NativeType = typename CompareType<PT>::NativeType;
175
3.49k
    static UInt8 apply(NativeType a, NativeType b) { return Compare::less(a, b); }
_ZN5doris6LessOpILNS_13PrimitiveTypeE5EE5applyEii
Line
Count
Source
175
17
    static UInt8 apply(NativeType a, NativeType b) { return Compare::less(a, b); }
_ZN5doris6LessOpILNS_13PrimitiveTypeE6EE5applyEll
Line
Count
Source
175
3
    static UInt8 apply(NativeType a, NativeType b) { return Compare::less(a, b); }
_ZN5doris6LessOpILNS_13PrimitiveTypeE7EE5applyEnn
Line
Count
Source
175
2.50k
    static UInt8 apply(NativeType a, NativeType b) { return Compare::less(a, b); }
_ZN5doris6LessOpILNS_13PrimitiveTypeE35EE5applyEN4wide7integerILm256EiEES5_
Line
Count
Source
175
972
    static UInt8 apply(NativeType a, NativeType b) { return Compare::less(a, b); }
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE2EE5applyEhh
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE3EE5applyEaa
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE4EE5applyEss
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE36EE5applyEjj
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE37EE5applyEoo
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE8EE5applyEff
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE9EE5applyEdd
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE27EE5applyEdd
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE28EE5applyEii
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE29EE5applyEll
Unexecuted instantiation: _ZN5doris6LessOpILNS_13PrimitiveTypeE30EE5applyEnn
176
};
177
178
template <>
179
struct LessOp<TYPE_DECIMALV2> {
180
0
    static UInt8 apply(Int128 a, Int128 b) { return a < b; }
181
};
182
183
template <>
184
struct LessOp<TYPE_DATE> {
185
    using SymmetricOp = GreaterOp<TYPE_DATE>;
186
    using NativeType = typename CompareType<TYPE_DATE>::NativeType;
187
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a < b; }
188
};
189
190
template <>
191
struct LessOp<TYPE_DATETIME> {
192
    using SymmetricOp = GreaterOp<TYPE_DATETIME>;
193
    using NativeType = typename CompareType<TYPE_DATETIME>::NativeType;
194
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a < b; }
195
};
196
197
template <>
198
struct LessOp<TYPE_DATEV2> {
199
    using SymmetricOp = GreaterOp<TYPE_DATEV2>;
200
    using NativeType = typename CompareType<TYPE_DATEV2>::NativeType;
201
    static UInt8 apply(const DateV2Value<DateV2ValueType>& a,
202
0
                       const DateV2Value<DateV2ValueType>& b) {
203
0
        return a < b;
204
0
    }
205
};
206
207
template <>
208
struct LessOp<TYPE_DATETIMEV2> {
209
    using SymmetricOp = GreaterOp<TYPE_DATETIMEV2>;
210
    using NativeType = typename CompareType<TYPE_DATETIMEV2>::NativeType;
211
    static UInt8 apply(const DateV2Value<DateTimeV2ValueType>& a,
212
0
                       const DateV2Value<DateTimeV2ValueType>& b) {
213
0
        return a < b;
214
0
    }
215
};
216
217
template <>
218
struct LessOp<TYPE_TIMESTAMPTZ> {
219
    using SymmetricOp = GreaterOp<TYPE_TIMESTAMPTZ>;
220
    using NativeType = typename CompareType<TYPE_TIMESTAMPTZ>::NativeType;
221
0
    static UInt8 apply(const TimestampTzValue& a, const TimestampTzValue& b) { return a < b; }
222
};
223
224
template <>
225
struct LessOp<TYPE_STRING> {
226
0
    static UInt8 apply(StringRef a, StringRef b) { return a < b; }
227
};
228
229
template <PrimitiveType PT>
230
struct GreaterOp {
231
    using SymmetricOp = LessOp<PT>;
232
    using NativeType = typename CompareType<PT>::NativeType;
233
33
    static UInt8 apply(NativeType a, NativeType b) { return Compare::greater(a, b); }
_ZN5doris9GreaterOpILNS_13PrimitiveTypeE5EE5applyEii
Line
Count
Source
233
33
    static UInt8 apply(NativeType a, NativeType b) { return Compare::greater(a, b); }
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE2EE5applyEhh
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE3EE5applyEaa
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE4EE5applyEss
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE6EE5applyEll
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE7EE5applyEnn
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE36EE5applyEjj
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE37EE5applyEoo
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE8EE5applyEff
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE9EE5applyEdd
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE27EE5applyEdd
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE35EE5applyEN4wide7integerILm256EiEES5_
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE28EE5applyEii
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE29EE5applyEll
Unexecuted instantiation: _ZN5doris9GreaterOpILNS_13PrimitiveTypeE30EE5applyEnn
234
};
235
236
template <>
237
struct GreaterOp<TYPE_DECIMALV2> {
238
0
    static UInt8 apply(Int128 a, Int128 b) { return a > b; }
239
};
240
241
template <>
242
struct GreaterOp<TYPE_DATE> {
243
    using SymmetricOp = LessOp<TYPE_DATE>;
244
    using NativeType = typename CompareType<TYPE_DATE>::NativeType;
245
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a > b; }
246
};
247
248
template <>
249
struct GreaterOp<TYPE_DATETIME> {
250
    using SymmetricOp = LessOp<TYPE_DATETIME>;
251
    using NativeType = typename CompareType<TYPE_DATETIME>::NativeType;
252
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a > b; }
253
};
254
255
template <>
256
struct GreaterOp<TYPE_DATEV2> {
257
    using SymmetricOp = LessOp<TYPE_DATEV2>;
258
    using NativeType = typename CompareType<TYPE_DATEV2>::NativeType;
259
    static UInt8 apply(const DateV2Value<DateV2ValueType>& a,
260
0
                       const DateV2Value<DateV2ValueType>& b) {
261
0
        return a > b;
262
0
    }
263
};
264
265
template <>
266
struct GreaterOp<TYPE_DATETIMEV2> {
267
    using SymmetricOp = LessOp<TYPE_DATETIMEV2>;
268
    using NativeType = typename CompareType<TYPE_DATETIMEV2>::NativeType;
269
    static UInt8 apply(const DateV2Value<DateTimeV2ValueType>& a,
270
0
                       const DateV2Value<DateTimeV2ValueType>& b) {
271
0
        return a > b;
272
0
    }
273
};
274
275
template <>
276
struct GreaterOp<TYPE_TIMESTAMPTZ> {
277
    using SymmetricOp = LessOp<TYPE_TIMESTAMPTZ>;
278
    using NativeType = typename CompareType<TYPE_TIMESTAMPTZ>::NativeType;
279
0
    static UInt8 apply(const TimestampTzValue& a, const TimestampTzValue& b) { return a > b; }
280
};
281
282
template <>
283
struct GreaterOp<TYPE_STRING> {
284
0
    static UInt8 apply(StringRef a, StringRef b) { return a > b; }
285
};
286
287
template <PrimitiveType PT>
288
struct GreaterOrEqualsOp;
289
290
template <PrimitiveType PT>
291
struct LessOrEqualsOp {
292
    using SymmetricOp = GreaterOrEqualsOp<PT>;
293
    using NativeType = typename CompareType<PT>::NativeType;
294
3
    static UInt8 apply(NativeType a, NativeType b) { return Compare::less_equal(a, b); }
_ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE5EE5applyEii
Line
Count
Source
294
3
    static UInt8 apply(NativeType a, NativeType b) { return Compare::less_equal(a, b); }
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE6EE5applyEll
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE7EE5applyEnn
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE35EE5applyEN4wide7integerILm256EiEES5_
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE2EE5applyEhh
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE3EE5applyEaa
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE4EE5applyEss
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE36EE5applyEjj
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE37EE5applyEoo
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE8EE5applyEff
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE9EE5applyEdd
Unexecuted instantiation: _ZN5doris14LessOrEqualsOpILNS_13PrimitiveTypeE27EE5applyEdd
295
};
296
297
template <>
298
struct LessOrEqualsOp<TYPE_DECIMALV2> {
299
0
    static UInt8 apply(DecimalV2Value a, DecimalV2Value b) { return a <= b; }
300
};
301
302
template <>
303
struct LessOrEqualsOp<TYPE_DATE> {
304
    using SymmetricOp = GreaterOrEqualsOp<TYPE_DATE>;
305
    using NativeType = typename CompareType<TYPE_DATE>::NativeType;
306
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a <= b; }
307
};
308
309
template <>
310
struct LessOrEqualsOp<TYPE_DATETIME> {
311
    using SymmetricOp = GreaterOrEqualsOp<TYPE_DATETIME>;
312
    using NativeType = typename CompareType<TYPE_DATETIME>::NativeType;
313
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a <= b; }
314
};
315
316
template <>
317
struct LessOrEqualsOp<TYPE_DATEV2> {
318
    using SymmetricOp = GreaterOrEqualsOp<TYPE_DATEV2>;
319
    using NativeType = typename CompareType<TYPE_DATEV2>::NativeType;
320
    static UInt8 apply(const DateV2Value<DateV2ValueType>& a,
321
0
                       const DateV2Value<DateV2ValueType>& b) {
322
0
        return a <= b;
323
0
    }
324
};
325
326
template <>
327
struct LessOrEqualsOp<TYPE_DATETIMEV2> {
328
    using SymmetricOp = GreaterOrEqualsOp<TYPE_DATETIMEV2>;
329
    using NativeType = typename CompareType<TYPE_DATETIMEV2>::NativeType;
330
    static UInt8 apply(const DateV2Value<DateTimeV2ValueType>& a,
331
0
                       const DateV2Value<DateTimeV2ValueType>& b) {
332
0
        return a <= b;
333
0
    }
334
};
335
336
template <>
337
struct LessOrEqualsOp<TYPE_TIMESTAMPTZ> {
338
    using SymmetricOp = GreaterOrEqualsOp<TYPE_TIMESTAMPTZ>;
339
    using NativeType = typename CompareType<TYPE_TIMESTAMPTZ>::NativeType;
340
0
    static UInt8 apply(const TimestampTzValue& a, const TimestampTzValue& b) { return a <= b; }
341
};
342
343
template <PrimitiveType PT>
344
struct GreaterOrEqualsOp {
345
    using SymmetricOp = LessOrEqualsOp<PT>;
346
    using NativeType = typename CompareType<PT>::NativeType;
347
2
    static UInt8 apply(NativeType a, NativeType b) { return Compare::greater_equal(a, b); }
_ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE5EE5applyEii
Line
Count
Source
347
2
    static UInt8 apply(NativeType a, NativeType b) { return Compare::greater_equal(a, b); }
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE2EE5applyEhh
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE3EE5applyEaa
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE4EE5applyEss
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE6EE5applyEll
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE7EE5applyEnn
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE36EE5applyEjj
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE37EE5applyEoo
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE8EE5applyEff
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE9EE5applyEdd
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE27EE5applyEdd
Unexecuted instantiation: _ZN5doris17GreaterOrEqualsOpILNS_13PrimitiveTypeE35EE5applyEN4wide7integerILm256EiEES5_
348
};
349
350
template <>
351
struct GreaterOrEqualsOp<TYPE_DECIMALV2> {
352
0
    static UInt8 apply(DecimalV2Value a, DecimalV2Value b) { return a >= b; }
353
};
354
355
template <>
356
struct GreaterOrEqualsOp<TYPE_DATE> {
357
    using SymmetricOp = LessOrEqualsOp<TYPE_DATE>;
358
    using NativeType = typename CompareType<TYPE_DATE>::NativeType;
359
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a >= b; }
360
};
361
362
template <>
363
struct GreaterOrEqualsOp<TYPE_DATETIME> {
364
    using SymmetricOp = LessOrEqualsOp<TYPE_DATETIME>;
365
    using NativeType = typename CompareType<TYPE_DATETIME>::NativeType;
366
0
    static UInt8 apply(const VecDateTimeValue& a, const VecDateTimeValue& b) { return a >= b; }
367
};
368
369
template <>
370
struct GreaterOrEqualsOp<TYPE_DATEV2> {
371
    using SymmetricOp = LessOrEqualsOp<TYPE_DATEV2>;
372
    using NativeType = typename CompareType<TYPE_DATEV2>::NativeType;
373
    static UInt8 apply(const DateV2Value<DateV2ValueType>& a,
374
0
                       const DateV2Value<DateV2ValueType>& b) {
375
0
        return a >= b;
376
0
    }
377
};
378
379
template <>
380
struct GreaterOrEqualsOp<TYPE_DATETIMEV2> {
381
    using SymmetricOp = LessOrEqualsOp<TYPE_DATETIMEV2>;
382
    using NativeType = typename CompareType<TYPE_DATETIMEV2>::NativeType;
383
    static UInt8 apply(const DateV2Value<DateTimeV2ValueType>& a,
384
0
                       const DateV2Value<DateTimeV2ValueType>& b) {
385
0
        return a >= b;
386
0
    }
387
};
388
389
template <>
390
struct GreaterOrEqualsOp<TYPE_TIMESTAMPTZ> {
391
    using SymmetricOp = LessOrEqualsOp<TYPE_TIMESTAMPTZ>;
392
    using NativeType = typename CompareType<TYPE_TIMESTAMPTZ>::NativeType;
393
0
    static UInt8 apply(const TimestampTzValue& a, const TimestampTzValue& b) { return a >= b; }
394
};
395
396
} // namespace doris