mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
organize code [#METR-23881]
This commit is contained in:
parent
405382b092
commit
2b38babb89
@ -21,6 +21,9 @@ public:
|
||||
protected:
|
||||
Block readImpl() override;
|
||||
|
||||
private:
|
||||
ConstColumnPlainPtrs getKeyColumns(Block & block) const;
|
||||
|
||||
private:
|
||||
using MapHashed = HashMap<UInt128, UInt64, UInt128TrivialHash>;
|
||||
|
||||
|
@ -25,21 +25,11 @@ Block LimitByBlockInputStream::readImpl()
|
||||
if (!block)
|
||||
return Block();
|
||||
|
||||
size_t rows = block.rows();
|
||||
size_t old_set_size = set.size();
|
||||
const ConstColumnPlainPtrs column_ptrs(getKeyColumns(block));
|
||||
const size_t rows = block.rows();
|
||||
const size_t old_set_size = set.size();
|
||||
IColumn::Filter filter(rows);
|
||||
|
||||
ConstColumnPlainPtrs column_ptrs;
|
||||
column_ptrs.reserve(columns_names.size());
|
||||
|
||||
for (size_t i = 0; i < columns_names.size(); ++i)
|
||||
{
|
||||
auto & column = block.getByName(columns_names[i]).column;
|
||||
|
||||
if (!column->isConst())
|
||||
column_ptrs.emplace_back(column.get());
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < rows; ++i)
|
||||
{
|
||||
UInt128 key;
|
||||
@ -76,4 +66,21 @@ Block LimitByBlockInputStream::readImpl()
|
||||
}
|
||||
}
|
||||
|
||||
ConstColumnPlainPtrs LimitByBlockInputStream::getKeyColumns(Block & block) const
|
||||
{
|
||||
ConstColumnPlainPtrs column_ptrs;
|
||||
column_ptrs.reserve(columns_names.size());
|
||||
|
||||
for (const auto & name : columns_names)
|
||||
{
|
||||
auto & column = block.getByName(name).column;
|
||||
|
||||
/// Ignore all constant columns.
|
||||
if (!column->isConst())
|
||||
column_ptrs.emplace_back(column.get());
|
||||
}
|
||||
|
||||
return column_ptrs;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user