fix another bug

This commit is contained in:
Alexander Tokmakov 2021-07-27 17:46:12 +03:00
parent 4862e9f80d
commit a5d27ba6ad
2 changed files with 8 additions and 2 deletions

View File

@ -36,8 +36,12 @@ public:
const DataTypeAggregateFunction * data_type = typeid_cast<const DataTypeAggregateFunction *>(argument.get());
if (!data_type || data_type->getFunctionName() != nested_func->getName())
throw Exception("Illegal type " + argument->getName() + " of argument for aggregate function " + getName(),
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Illegal type {} of argument for aggregate function {}",
argument->getName(), getName());
if (data_type->getParameters() != getParameters())
throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Illegal type {} of argument for aggregate function {}: "
"parameters mismatch", argument->getName(), getName());
}
String getName() const override

View File

@ -33,6 +33,8 @@ public:
const char * getFamilyName() const override { return "AggregateFunction"; }
TypeIndex getTypeId() const override { return TypeIndex::AggregateFunction; }
Array getParameters() const { return parameters; }
bool canBeInsideNullable() const override { return false; }
DataTypePtr getReturnType() const { return function->getReturnType(); }