mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 01:41:59 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
30 lines
596 B
C++
30 lines
596 B
C++
#include <DataStreams/materializeBlock.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
Block materializeBlock(const Block & block)
|
|
{
|
|
if (!block)
|
|
return block;
|
|
|
|
Block res = block;
|
|
size_t columns = res.columns();
|
|
for (size_t i = 0; i < columns; ++i)
|
|
{
|
|
auto & element = res.getByPosition(i);
|
|
element.column = element.column->convertToFullColumnIfConst();
|
|
}
|
|
|
|
return res;
|
|
}
|
|
|
|
void materializeBlockInplace(Block & block)
|
|
{
|
|
for (size_t i = 0; i < block.columns(); ++i)
|
|
block.getByPosition(i).column = block.getByPosition(i).column->convertToFullColumnIfConst();
|
|
}
|
|
|
|
}
|