1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#include "mkql_builtins_decimal.h" // Y_IGNORE
namespace NKikimr {
namespace NMiniKQL {
namespace {
template<typename TInput, typename TOutput>
struct TPlus : public TSimpleArithmeticUnary<TInput, TOutput, TPlus<TInput, TOutput>> {
static TOutput Do(TInput val)
{
return +val;
}
#ifndef MKQL_DISABLE_CODEGEN
static Value* Gen(Value* arg, const TCodegenContext&, BasicBlock*&)
{
return arg;
}
#endif
};
struct TDecimalPlus {
static NUdf::TUnboxedValuePod Execute(const NUdf::TUnboxedValuePod& arg) {
return arg;
}
#ifndef MKQL_DISABLE_CODEGEN
static Value* Generate(Value* arg, const TCodegenContext&, BasicBlock*&)
{
return arg;
}
#endif
};
}
void RegisterPlus(IBuiltinFunctionRegistry& registry) {
RegisterUnaryNumericFunctionOpt<TPlus, TUnaryArgsOpt>(registry, "Plus");
NDecimal::RegisterUnaryFunction<TDecimalPlus, TUnaryArgsOpt>(registry, "Plus");
RegisterFunctionUnOpt<NUdf::TDataType<NUdf::TInterval>, NUdf::TDataType<NUdf::TInterval>, TPlus, TUnaryArgsOpt>(registry, "Plus");
RegisterFunctionUnOpt<NUdf::TDataType<NUdf::TInterval64>, NUdf::TDataType<NUdf::TInterval64>, TPlus, TUnaryArgsOpt>(registry, "Plus");
}
} // namespace NMiniKQL
} // namespace NKikimr
|