mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 03:12:43 +00:00
Try fix aggregating.
This commit is contained in:
parent
36604e93ce
commit
bcebad1d60
@ -185,7 +185,7 @@ void AggregatingSortedTransform::merge()
|
||||
if (key_differs)
|
||||
{
|
||||
/// Write the simple aggregation result for the previous group.
|
||||
if (merged_data.mergedRows() > 0)
|
||||
if (merged_data.isGroupStarted())
|
||||
{
|
||||
insertSimpleAggregationResult();
|
||||
merged_data.insertRow();
|
||||
@ -227,7 +227,7 @@ void AggregatingSortedTransform::merge()
|
||||
}
|
||||
|
||||
/// Write the simple aggregation result for the previous group.
|
||||
if (merged_data.mergedRows() > 0)
|
||||
if (merged_data.isGroupStarted())
|
||||
{
|
||||
insertSimpleAggregationResult();
|
||||
merged_data.insertRow();
|
||||
|
@ -63,10 +63,15 @@ private:
|
||||
{
|
||||
for (auto column_number : column_numbers)
|
||||
columns[column_number]->insertFrom(*raw_columns[column_number], row);
|
||||
|
||||
is_group_started = true;
|
||||
}
|
||||
|
||||
bool isGroupStarted() const { return is_group_started; }
|
||||
|
||||
void insertRow()
|
||||
{
|
||||
is_group_started = false;
|
||||
++total_merged_rows;
|
||||
++merged_rows;
|
||||
/// TODO: sum_blocks_granularity += block_size;
|
||||
@ -81,6 +86,8 @@ private:
|
||||
for (auto & desc : def.columns_to_aggregate)
|
||||
desc.column = typeid_cast<ColumnAggregateFunction *>(columns[desc.column_number].get());
|
||||
}
|
||||
private:
|
||||
bool is_group_started = false;
|
||||
};
|
||||
|
||||
ColumnsDefinition columns_definition;
|
||||
|
Loading…
Reference in New Issue
Block a user