ClickHouse/dbms/src/Processors/Transforms/MaterializingTransform.cpp

22 lines
531 B
C++
Raw Normal View History

2019-03-25 16:58:59 +00:00
#include <Processors/Transforms/MaterializingTransform.h>
#include <DataStreams/materializeBlock.h>
namespace DB
{
MaterializingTransform::MaterializingTransform(const Block & header)
: ISimpleTransform(header, materializeBlock(header), false) {}
void MaterializingTransform::transform(Chunk & chunk)
{
auto num_rows = chunk.getNumRows();
auto columns = chunk.detachColumns();
for (auto & col : columns)
col = col->convertToFullColumnIfConst();
chunk.setColumns(std::move(columns), num_rows);
}
}