mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Better exception message #9810
This commit is contained in:
parent
fd9e3e3b34
commit
d43903211a
@ -2394,10 +2394,17 @@ protected:
|
|||||||
|
|
||||||
DataTypePtr getReturnType(const ColumnsWithTypeAndName & arguments) const override
|
DataTypePtr getReturnType(const ColumnsWithTypeAndName & arguments) const override
|
||||||
{
|
{
|
||||||
const auto type_col = checkAndGetColumnConst<ColumnString>(arguments.back().column.get());
|
const auto & column = arguments.back().column;
|
||||||
|
if (!column)
|
||||||
|
throw Exception("Second argument to " + getName() + " must be a constant string describing type."
|
||||||
|
" Instead there is non-constant column of type " + arguments.back().type->getName(),
|
||||||
|
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
||||||
|
|
||||||
|
const auto type_col = checkAndGetColumnConst<ColumnString>(column.get());
|
||||||
if (!type_col)
|
if (!type_col)
|
||||||
throw Exception("Second argument to " + getName() + " must be a constant string describing type",
|
throw Exception("Second argument to " + getName() + " must be a constant string describing type."
|
||||||
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
" Instead there is a column with the following structure: " + column->dumpStructure(),
|
||||||
|
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
||||||
|
|
||||||
return DataTypeFactory::instance().get(type_col->getValue<String>());
|
return DataTypeFactory::instance().get(type_col->getValue<String>());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user