mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Better semantic of sharing columns: development [#CLICKHOUSE-2].
This commit is contained in:
parent
6f7d2b99ea
commit
f501f6990e
@ -803,6 +803,8 @@ void Join::joinBlockImplCross(Block & block) const
|
||||
size_t num_existing_columns = block.columns();
|
||||
size_t num_columns_to_add = sample_block_with_columns_to_add.columns();
|
||||
|
||||
size_t rows_left = block.rows();
|
||||
|
||||
ColumnRawPtrs src_left_columns(num_existing_columns);
|
||||
MutableColumns dst_columns(num_existing_columns + num_columns_to_add);
|
||||
|
||||
@ -816,10 +818,9 @@ void Join::joinBlockImplCross(Block & block) const
|
||||
{
|
||||
const ColumnWithTypeAndName & src_column = sample_block_with_columns_to_add.getByPosition(i);
|
||||
dst_columns[num_existing_columns + i] = src_column.column->cloneEmpty();
|
||||
block.insert(src_column);
|
||||
}
|
||||
|
||||
size_t rows_left = block.rows();
|
||||
|
||||
/// NOTE It would be better to use `reserve`, as well as `replicate` methods to duplicate the values of the left block.
|
||||
|
||||
for (size_t i = 0; i < rows_left; ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user