aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Functions/max2.cpp
blob: 928e6f22918515e10cff06125148281658e388b7 (plain) (blame)
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
#include <Functions/FunctionFactory.h>
#include <Functions/FunctionMathBinaryFloat64.h>

namespace DB
{
namespace
{
    struct Max2Name
    {
        static constexpr auto name = "max2";
    };

    template <typename T>
    T max(T a, T b)
    {
        return a > b ? a : b;
    }

    using FunctionMax2 = FunctionMathBinaryFloat64<BinaryFunctionVectorized<Max2Name, max>>;
}

REGISTER_FUNCTION(Max2)
{
    factory.registerFunction<FunctionMax2>({}, FunctionFactory::CaseInsensitive);
}
}