Context:
In AbstractGroupByVariable when retrieving results of a report grouped by number variable of type double, we round the bucket key to two decimal places. In certain edge cases, this can lead to duplicate bucket keys.
Currently (due to changes in OPT-4223), if buckets with duplicate keys exist they are replaced in the result map. Previously, duplicate bucket keys would have resulted in duplicate groupByResults in the result list - both not a good solution.
Instead, we should either adjust the result retrieval so that when a duplicate key is found, the results are added together or alternatively we could think about adjusting the range aggregation creation so that the bucket key is always exactly the same as the actual start of the bucket range, so that no duplicate buckets exist.
Hint: this PR comment shows where we currently replace duplicate bucketsĀ https://github.com/camunda/camunda-optimize/pull/2596#discussion_r486260317
AT:
- duplicate buckets when aggregating a double number variable are either avoided or handled correctly when retrieving results
- IT asserts the above mentioned edge case of multiple double variables that result in the same key when rounded