mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
commit
2a57e69111
@ -268,7 +268,7 @@ public:
|
||||
void merge(const AggregateFunctionHistogramData & other, UInt32 max_bins)
|
||||
{
|
||||
lower_bound = std::min(lower_bound, other.lower_bound);
|
||||
upper_bound = std::max(lower_bound, other.upper_bound);
|
||||
upper_bound = std::max(upper_bound, other.upper_bound);
|
||||
for (size_t i = 0; i < other.size; i++)
|
||||
add(other.points[i].mean, other.points[i].weight, max_bins);
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
0 55 101
|
||||
55 117 97
|
||||
117 199 92
|
||||
0 55 101
|
||||
55 117 97
|
||||
117 199 92
|
2
dbms/tests/queries/0_stateless/00919_histogram_merge.sql
Normal file
2
dbms/tests/queries/0_stateless/00919_histogram_merge.sql
Normal file
@ -0,0 +1,2 @@
|
||||
WITH arrayJoin(finalizeAggregation((SELECT histogramState(3)(number) FROM numbers(10, 190)) + (SELECT histogramState(3)(number) FROM numbers(0, 100)))) AS hist SELECT round(hist.1) AS l, round(hist.2) AS r, round(hist.3) AS cnt;
|
||||
WITH arrayJoin(finalizeAggregation((SELECT histogramState(3)(number) FROM numbers(0, 100)) + (SELECT histogramState(3)(number) FROM numbers(10, 190)))) AS hist SELECT round(hist.1) AS l, round(hist.2) AS r, round(hist.3) AS cnt;
|
Loading…
Reference in New Issue
Block a user