mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 11:22:12 +00:00
Try fix summing.
This commit is contained in:
parent
704a94f022
commit
0fe5528842
@ -168,6 +168,8 @@ void AggregatingSortedTransform::merge()
|
||||
bool has_previous_group = !last_key.empty();
|
||||
|
||||
SortCursor current = queue.current();
|
||||
|
||||
{
|
||||
detail::RowRef current_key;
|
||||
current_key.set(current);
|
||||
|
||||
@ -176,6 +178,10 @@ void AggregatingSortedTransform::merge()
|
||||
else
|
||||
key_differs = !last_key.hasEqualSortColumnsWith(current_key);
|
||||
|
||||
last_key = current_key;
|
||||
last_chunk_sort_columns.clear();
|
||||
}
|
||||
|
||||
if (key_differs)
|
||||
{
|
||||
/// if there are enough rows accumulated and the last one is calculated completely
|
||||
@ -183,7 +189,6 @@ void AggregatingSortedTransform::merge()
|
||||
{
|
||||
/// Write the simple aggregation result for the previous group.
|
||||
insertSimpleAggregationResult();
|
||||
last_key.reset();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -211,8 +216,6 @@ void AggregatingSortedTransform::merge()
|
||||
|
||||
if (!current->isLast())
|
||||
{
|
||||
last_key = current_key;
|
||||
last_chunk_sort_columns.clear();
|
||||
queue.next();
|
||||
}
|
||||
else
|
||||
|
@ -540,6 +540,8 @@ void SummingSortedTransform::merge()
|
||||
bool has_previous_group = !last_key.empty();
|
||||
|
||||
SortCursor current = queue.current();
|
||||
|
||||
{
|
||||
detail::RowRef current_key;
|
||||
current_key.set(current);
|
||||
|
||||
@ -551,6 +553,10 @@ void SummingSortedTransform::merge()
|
||||
else
|
||||
key_differs = !last_key.hasEqualSortColumnsWith(current_key);
|
||||
|
||||
last_key = current_key;
|
||||
last_chunk_sort_columns.clear();
|
||||
}
|
||||
|
||||
if (key_differs)
|
||||
{
|
||||
if (has_previous_group)
|
||||
@ -599,8 +605,6 @@ void SummingSortedTransform::merge()
|
||||
|
||||
if (!current->isLast())
|
||||
{
|
||||
last_key = current_key;
|
||||
last_chunk_sort_columns.clear();
|
||||
queue.next();
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user