ClickHouse/src/Functions/less.cpp
Nikolai Kochetov 32a23244c9 Remove context from comparison functions.
(cherry picked from commit 57608cc6f9)
2024-02-14 12:38:13 +00:00

43 lines
1.3 KiB
C++

#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsComparison.h>
#include <Functions/FunctionsLogical.h>
namespace DB
{
using FunctionLess = FunctionComparison<LessOp, NameLess>;
using FunctionEquals = FunctionComparison<EqualsOp, NameEquals>;
REGISTER_FUNCTION(Less)
{
factory.registerFunction<FunctionLess>();
}
template <>
ColumnPtr FunctionComparison<LessOp, NameLess>::executeTupleImpl(
const ColumnsWithTypeAndName & x, const ColumnsWithTypeAndName & y, size_t tuple_size, size_t input_rows_count) const
{
FunctionOverloadResolverPtr less
= std::make_unique<FunctionToOverloadResolverAdaptor>(std::make_shared<FunctionLess>(check_decimal_overflow));
FunctionOverloadResolverPtr func_builder_or
= std::make_unique<FunctionToOverloadResolverAdaptor>(std::make_shared<FunctionOr>());
FunctionOverloadResolverPtr func_builder_and
= std::make_unique<FunctionToOverloadResolverAdaptor>(std::make_shared<FunctionAnd>());
FunctionOverloadResolverPtr func_builder_equals
= std::make_unique<FunctionToOverloadResolverAdaptor>(std::make_shared<FunctionEquals>(check_decimal_overflow));
return executeTupleLessGreaterImpl(
less,
less,
func_builder_and,
func_builder_or,
func_builder_equals,
x, y, tuple_size, input_rows_count);
}
}