mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 12:32:04 +00:00
22 lines
546 B
C++
22 lines
546 B
C++
#include <Processors/Transforms/MaterializingTransform.h>
|
|
#include <Columns/ColumnSparse.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 = recursiveRemoveSparse(col->convertToFullColumnIfConst());
|
|
|
|
chunk.setColumns(std::move(columns), num_rows);
|
|
}
|
|
|
|
}
|