Try fix header for TTLBlockInputStream.

This commit is contained in:
Nikolai Kochetov 2020-11-03 17:26:47 +03:00
parent feccf47f27
commit 9f7de6a1a4

View File

@ -103,6 +103,15 @@ bool TTLBlockInputStream::isTTLExpired(time_t ttl) const
return (ttl && (ttl <= current_time));
}
Block reorderColumns(Block block, const Block & header)
{
Block res;
for (const auto & col : header)
res.insert(block.getByName(col.name));
return res;
}
Block TTLBlockInputStream::readImpl()
{
/// Skip all data if table ttl is expired for part
@ -136,7 +145,7 @@ Block TTLBlockInputStream::readImpl()
updateMovesTTL(block);
updateRecompressionTTL(block);
return block;
return reorderColumns(std::move(block), header);
}
void TTLBlockInputStream::readSuffixImpl()