2018-09-02 01:26:08 +00:00
|
|
|
#include <Functions/FunctionFactory.h>
|
|
|
|
#include <Functions/FunctionsComparison.h>
|
2023-08-30 19:53:32 +00:00
|
|
|
#include <Functions/FunctionsLogical.h>
|
2018-09-02 01:26:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
using FunctionLess = FunctionComparison<LessOp, NameLess>;
|
2023-08-30 19:53:32 +00:00
|
|
|
using FunctionEquals = FunctionComparison<EqualsOp, NameEquals>;
|
2018-09-02 01:26:08 +00:00
|
|
|
|
2022-07-04 07:01:39 +00:00
|
|
|
REGISTER_FUNCTION(Less)
|
2018-09-02 01:26:08 +00:00
|
|
|
{
|
|
|
|
factory.registerFunction<FunctionLess>();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
2020-10-17 14:23:37 +00:00
|
|
|
ColumnPtr FunctionComparison<LessOp, NameLess>::executeTupleImpl(
|
|
|
|
const ColumnsWithTypeAndName & x, const ColumnsWithTypeAndName & y, size_t tuple_size, size_t input_rows_count) const
|
2018-09-02 01:26:08 +00:00
|
|
|
{
|
2023-08-30 19:53:32 +00:00
|
|
|
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));
|
2020-02-23 22:46:52 +00:00
|
|
|
|
|
|
|
return executeTupleLessGreaterImpl(
|
|
|
|
less,
|
|
|
|
less,
|
2023-08-30 19:53:32 +00:00
|
|
|
func_builder_and,
|
|
|
|
func_builder_or,
|
|
|
|
func_builder_equals,
|
2020-10-17 14:23:37 +00:00
|
|
|
x, y, tuple_size, input_rows_count);
|
2018-09-02 01:26:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|