aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Processors/Transforms/MaterializingTransform.cpp
blob: 1eaa5458d3724c4ad58186a4a5ef5e7c47338719 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#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);
}

}