mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 18:42:26 +00:00
Improve implementation of sumMap for tuples
This commit is contained in:
parent
fcacca68d7
commit
602baf62f0
@ -81,17 +81,16 @@ public:
|
|||||||
void add(AggregateDataPtr place, const IColumn ** columns, const size_t row_num, Arena *) const override
|
void add(AggregateDataPtr place, const IColumn ** columns, const size_t row_num, Arena *) const override
|
||||||
{
|
{
|
||||||
// Check if tuple
|
// Check if tuple
|
||||||
std::unique_ptr<const IColumn *[]> tuple_columns;
|
|
||||||
auto tuple_col = checkAndGetColumn<ColumnTuple>(columns[0]);
|
auto tuple_col = checkAndGetColumn<ColumnTuple>(columns[0]);
|
||||||
if (tuple_col)
|
if (tuple_col)
|
||||||
{
|
addImpl(place, tuple_col->getColumns(), row_num);
|
||||||
tuple_columns.reset(new const IColumn*[tuple_col->tupleSize()]);
|
else
|
||||||
for (size_t i = 0; i < tuple_col->tupleSize(); i++)
|
addImpl(place, columns, row_num);
|
||||||
tuple_columns.get()[i] = &const_cast<IColumn&>(tuple_col->getColumn(i));
|
}
|
||||||
|
|
||||||
columns = tuple_columns.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
template<typename TColumns>
|
||||||
|
void addImpl(AggregateDataPtr place, TColumns & columns, const size_t row_num) const
|
||||||
|
{
|
||||||
// Column 0 contains array of keys of known type
|
// Column 0 contains array of keys of known type
|
||||||
Field key_field;
|
Field key_field;
|
||||||
const ColumnArray & array_column0 = assert_cast<const ColumnArray &>(*columns[0]);
|
const ColumnArray & array_column0 = assert_cast<const ColumnArray &>(*columns[0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user