From 652067781479fa724a6b75c4ee4fbdd3e3bf62f0 Mon Sep 17 00:00:00 2001 From: Nikita Mikhaylov Date: Fri, 30 Aug 2024 20:47:38 +0000 Subject: [PATCH] Beautify --- src/Functions/randDistribution.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Functions/randDistribution.cpp b/src/Functions/randDistribution.cpp index 602f4fd18e1..10a3280010c 100644 --- a/src/Functions/randDistribution.cpp +++ b/src/Functions/randDistribution.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -236,14 +237,9 @@ private: } else { - std::string expectedType; - if (std::is_same_v) - expectedType = "UInt64"; - else if (std::is_same_v) - expectedType = "Float64"; - + auto expected_type = Field(Field::Types::Which(Field::TypeToEnum>::value)).getTypeName(); throw Exception(ErrorCodes::BAD_ARGUMENTS, "Parameter number {} of function {} is expected to be {} but is {}", - parameter_number, getName(), expectedType, col->getName()); + parameter_number, getName(), expected_type, col->getName()); } if (isNaN(parameter) || !std::isfinite(parameter))