Wrap const columns in RemoteBlockInputStream.

This commit is contained in:
Nikolai Kochetov 2019-08-13 13:02:58 +03:00
parent b5c9be75c4
commit 8f55fdbd15

View File

@ -164,7 +164,18 @@ static Block adaptBlockStructure(const Block & block, const Block & header, cons
res.info = block.info;
for (const auto & elem : header)
res.insert({ castColumn(block.getByName(elem.name), elem.type, context), elem.type, elem.name });
{
ColumnPtr column;
if (elem.column && isColumnConst(*elem.column))
/// TODO: check that column from block contains the same value.
/// TODO: serialize const columns.
column = elem.column->cloneResized(block.rows());
else
column = castColumn(block.getByName(elem.name), elem.type, context);
res.insert({column, elem.type, elem.name});
}
return res;
}