Fix tests.

This commit is contained in:
Nikolai Kochetov 2018-07-20 15:30:04 +03:00
parent 3a74ec7c0c
commit df8e030b2d
3 changed files with 15 additions and 2 deletions

View File

@ -368,6 +368,18 @@ Block Block::cloneWithColumns(const Columns & columns) const
}
Block Block::cloneWithoutColumns() const
{
Block res;
size_t num_columns = data.size();
for (size_t i = 0; i < num_columns; ++i)
res.insert({ nullptr, data[i].type, data[i].name });
return res;
}
Block Block::sortColumns() const
{
Block sorted_block;

View File

@ -109,6 +109,7 @@ public:
Columns getColumns() const;
void setColumns(const Columns & columns);
Block cloneWithColumns(const Columns & columns) const;
Block cloneWithoutColumns() const;
/** Get empty columns with the same types as in block. */
MutableColumns cloneEmptyColumns() const;

View File

@ -308,7 +308,7 @@ void PreparedFunctionImpl::execute(Block & block, const ColumnNumbers & args, si
if (useDefaultImplementationForColumnsWithDictionary())
{
auto & res = block.safeGetByPosition(result);
Block block_without_dicts = block.cloneEmpty();
Block block_without_dicts = block.cloneWithoutColumns();
for (auto arg : args)
block_without_dicts.safeGetByPosition(arg).column = block.safeGetByPosition(arg).column;
@ -334,7 +334,7 @@ void PreparedFunctionImpl::execute(Block & block, const ColumnNumbers & args, si
else
{
convertColumnsWithDictionaryToFull(block_without_dicts, args);
executeWithoutColumnsWithDictionary(block_without_dicts, args, result, block_without_dicts.rows());
executeWithoutColumnsWithDictionary(block_without_dicts, args, result, input_rows_count);
res.column = block_without_dicts.safeGetByPosition(result).column;
}
}