diff --git a/dbms/src/Functions/FunctionsArray.cpp b/dbms/src/Functions/FunctionsArray.cpp index 254a39a2644..eefd92e401d 100644 --- a/dbms/src/Functions/FunctionsArray.cpp +++ b/dbms/src/Functions/FunctionsArray.cpp @@ -658,7 +658,8 @@ DataTypePtr FunctionArrayEnumerate::getReturnType(const DataTypes & arguments) c const DataTypeArray * array_type = typeid_cast(arguments[0].get()); if (!array_type) - throw Exception("First argument for function " + getName() + " must be array.", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + throw Exception("First argument for function " + getName() + " must be an array but it has type " + + arguments[0]->getName() + ".", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); return std::make_shared(std::make_shared()); } @@ -727,8 +728,8 @@ DataTypePtr FunctionArrayUniq:: getReturnType(const DataTypes & arguments) const { const DataTypeArray * array_type = typeid_cast(arguments[i].get()); if (!array_type) - throw Exception("All arguments for function " + getName() + " must be arrays; argument " + toString(i + 1) + " isn't.", - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + throw Exception("All arguments for function " + getName() + " must be arrays but argument " + + toString(i + 1) + " has type " + arguments[i]->getName() + ".", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } return std::make_shared(); @@ -952,8 +953,8 @@ DataTypePtr FunctionArrayEnumerateUniq::getReturnType(const DataTypes & argument { const DataTypeArray * array_type = typeid_cast(arguments[i].get()); if (!array_type) - throw Exception("All arguments for function " + getName() + " must be arrays; argument " + toString(i + 1) + " isn't.", - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + throw Exception("All arguments for function " + getName() + " must be arrays but argument " + + toString(i + 1) + " has type " + arguments[i]->getName() + ".", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } return std::make_shared(std::make_shared()); @@ -1791,8 +1792,8 @@ void FunctionArrayReduce::getReturnTypeAndPrerequisites( { const DataTypeArray * arg = typeid_cast(arguments[i].type.get()); if (!arg) - throw Exception("Argument " + toString(i) + " for function " + getName() + " must be array.", - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + throw Exception("Argument " + toString(i) + " for function " + getName() + " must be an array but it has type " + + arguments[i].type->getName() + ".", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); argument_types[i - 1] = arg->getNestedType()->clone(); }