mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
32a23244c9
(cherry picked from commit 57608cc6f9
)
43 lines
1.3 KiB
C++
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);
|
|
}
|
|
|
|
}
|