ClickHouse
41 строка · 1.4 Кб
1#include <Functions/FunctionFactory.h>
2#include <Functions/FunctionsComparison.h>
3#include <Functions/FunctionsLogical.h>
4
5namespace DB
6{
7
8using FunctionGreater = FunctionComparison<GreaterOp, NameGreater>;
9using FunctionEquals = FunctionComparison<EqualsOp, NameEquals>;
10
11REGISTER_FUNCTION(Greater)
12{
13factory.registerFunction<FunctionGreater>();
14}
15
16template <>
17ColumnPtr FunctionComparison<GreaterOp, NameGreater>::executeTupleImpl(
18const ColumnsWithTypeAndName & x, const ColumnsWithTypeAndName & y, size_t tuple_size, size_t input_rows_count) const
19{
20FunctionOverloadResolverPtr greater
21= std::make_unique<FunctionToOverloadResolverAdaptor>(std::make_shared<FunctionGreater>(check_decimal_overflow));
22
23FunctionOverloadResolverPtr func_builder_or
24= std::make_unique<FunctionToOverloadResolverAdaptor>(std::make_shared<FunctionOr>());
25
26FunctionOverloadResolverPtr func_builder_and
27= std::make_unique<FunctionToOverloadResolverAdaptor>(std::make_shared<FunctionAnd>());
28
29FunctionOverloadResolverPtr func_builder_equals
30= std::make_unique<FunctionToOverloadResolverAdaptor>(std::make_shared<FunctionEquals>(check_decimal_overflow));
31
32return executeTupleLessGreaterImpl(
33greater,
34greater,
35func_builder_and,
36func_builder_or,
37func_builder_equals,
38x, y, tuple_size, input_rows_count);
39}
40
41}
42