1#include <DataStreams/materializeBlock.h>
2
3
4namespace DB
5{
6
7Block materializeBlock(const Block & block)
8{
9 if (!block)
10 return block;
11
12 Block res = block;
13 size_t columns = res.columns();
14 for (size_t i = 0; i < columns; ++i)
15 {
16 auto & element = res.getByPosition(i);
17 element.column = element.column->convertToFullColumnIfConst();
18 }
19
20 return res;
21}
22
23void materializeBlockInplace(Block & block)
24{
25 for (size_t i = 0; i < block.columns(); ++i)
26 block.getByPosition(i).column = block.getByPosition(i).column->convertToFullColumnIfConst();
27}
28
29}
30