Update repeat.cpp

This commit is contained in:
alexey-milovidov 2019-09-23 02:02:03 +03:00 committed by GitHub
parent 4465fdb8bf
commit 61b02598d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,16 +178,18 @@ public:
Impl::vectorConst(copy_str, repeat_time, col_res->getChars(), col_res->getOffsets());
block.getByPosition(result).column = std::move(col_res);
}
else if (!castType(block.getByPosition(arguments[1]).type.get(), [&](const auto & type)
else if (!castType(block.getByPosition(arguments[1]).type.get(), [&](const auto & type)
{
using DataType = std::decay_t<decltype(type)>;
using T0 = typename DataType::FieldType;
const ColumnVector<T0> * colnum = checkAndGetColumn<ColumnVector<T0>>(numcolumn.get());
auto col_res = ColumnString::create();
Impl::vectorNonConstInteger(copy_str, col_res->getChars(), col_res->getOffsets(), colnum->getData());
block.getByPosition(result).column = std::move(col_res);
return 0;
}))
{
using DataType = std::decay_t<decltype(type)>;
using T0 = typename DataType::FieldType;
const ColumnVector<T0> * colnum = checkAndGetColumn<ColumnVector<T0>>(numcolumn.get());
auto col_res = ColumnString::create();
Impl::vectorNonConstInteger(copy_str, col_res->getChars(), col_res->getOffsets(), colnum->getData());
block.getByPosition(result).column = std::move(col_res);
return 0;
}));
}
else
throw Exception(
"Illegal column " + block.getByPosition(arguments[1]).column->getName() + " of argument of function " + getName(),