From 01bd5cc99800cd44812cefc23a45512ccbfc81e2 Mon Sep 17 00:00:00 2001 From: Pavel Kruglov Date: Mon, 7 Jun 2021 15:01:24 +0300 Subject: [PATCH] Clean up --- src/Functions/FunctionsLogical.cpp | 3 --- src/Functions/IFunction.h | 6 +++--- src/Functions/if.cpp | 4 +--- src/Functions/multiIf.cpp | 5 ++--- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/Functions/FunctionsLogical.cpp b/src/Functions/FunctionsLogical.cpp index a2f539b7b10..089c3d8c076 100644 --- a/src/Functions/FunctionsLogical.cpp +++ b/src/Functions/FunctionsLogical.cpp @@ -12,9 +12,6 @@ #include #include #include -#include - -#include #include diff --git a/src/Functions/IFunction.h b/src/Functions/IFunction.h index e27e422bae6..200f13867b0 100644 --- a/src/Functions/IFunction.h +++ b/src/Functions/IFunction.h @@ -284,6 +284,8 @@ public: void getLambdaArgumentTypes(DataTypes & arguments) const; + void checkNumberOfArguments(size_t number_of_arguments) const; + /// Get the main function name. virtual String getName() const = 0; @@ -358,8 +360,6 @@ protected: private: - void checkNumberOfArguments(size_t number_of_arguments) const; - DataTypePtr getReturnTypeWithoutLowCardinality(const ColumnsWithTypeAndName & arguments) const; }; @@ -414,7 +414,7 @@ public: */ virtual bool canBeExecutedOnDefaultArguments() const { return true; } - /// Properties from IFunctionBase + /// Properties from IFunctionBase (see IFunction.h) virtual bool isSuitableForConstantFolding() const { return true; } virtual ColumnPtr getConstantResultForNonConstArguments(const ColumnsWithTypeAndName & /*arguments*/, const DataTypePtr & /*result_type*/) const { return nullptr; } virtual bool isInjective(const ColumnsWithTypeAndName & /*sample_columns*/) const { return false; } diff --git a/src/Functions/if.cpp b/src/Functions/if.cpp index e199fbbdace..d7a6c79d495 100644 --- a/src/Functions/if.cpp +++ b/src/Functions/if.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -26,8 +26,6 @@ #include #include -#include - namespace DB { diff --git a/src/Functions/multiIf.cpp b/src/Functions/multiIf.cpp index 550710712ae..a5a16aacee3 100644 --- a/src/Functions/multiIf.cpp +++ b/src/Functions/multiIf.cpp @@ -3,14 +3,13 @@ #include #include #include +#include #include #include #include #include #include -#include -#include namespace DB { @@ -91,7 +90,7 @@ public: if (arg->onlyNull()) return; - const DataTypeNullable & nullable_type = static_cast(*arg); + const DataTypeNullable & nullable_type = typeid_cast(*arg); nested_type = nullable_type.getNestedType().get(); } else