ClickHouse/src/Functions/max2.cpp

23 lines
480 B
C++
Raw Normal View History

2021-08-26 12:34:46 +00:00
#include <Functions/FunctionMathBinaryFloat64.h>
#include <Functions/FunctionFactory.h>
template <typename T>
T max(T a, T b)
{
return a > b ? a : b;
}
namespace DB
{
namespace
{
struct Max2Name { static constexpr auto name = "max2"; };
using FunctionMax2 = FunctionMathBinaryFloat64<BinaryFunctionVectorized<Max2Name, max>>;
}
void registerFunctionMax2(FunctionFactory & factory)
{
factory.registerFunction<FunctionMax2>(FunctionFactory::CaseInsensitive);
}
}