Merge pull request #4777 from yandex/olegkv-master

Merging #4741
This commit is contained in:
alexey-milovidov 2019-03-23 17:25:48 +03:00 committed by GitHub
commit 2a57e69111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -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);
}

View File

@ -0,0 +1,6 @@
0 55 101
55 117 97
117 199 92
0 55 101
55 117 97
117 199 92

View 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;