v.21.1Improvements

Fix SimpleAggregateFunction in SummingMergeTree for Correct Aggregate Behavior

Fix SimpleAggregateFunction in SummingMergeTree. Now it works like AggregateFunction. In previous versions values were summed together regardless to the aggregate function. This fixes #18564 . #8052. #18637 (Amos Bird). Another fix of using SimpleAggregateFunction in SummingMergeTree. This fixes #18676 . #18677 (Amos Bird).
Fixes the behavior of SimpleAggregateFunction in SummingMergeTree so that it functions consistently like AggregateFunction, ensuring proper aggregation instead of naive summation.

Why it matters

Previously, values in SimpleAggregateFunction columns within SummingMergeTree were summed directly without respecting the aggregate function logic, leading to incorrect results. This fix resolves that issue by making the aggregation respect the function semantics, improving data correctness and reliability.

How to use it

Users benefit from this fix automatically when upgrading to this version. To use SimpleAggregateFunction correctly with SummingMergeTree, define the table with SimpleAggregateFunction as the column type and use the SummingMergeTree engine as usual; the aggregation behavior will now be correct without additional configuration.