mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 16:50:48 +00:00
Merge pull request #60532 from wangtZJU/fix_boundRatio_incorrect_merge
Fix boundRatio incorrect merge
This commit is contained in:
commit
8408758705
@ -63,6 +63,11 @@ struct AggregateFunctionBoundingRatioData
|
||||
{
|
||||
*this = other;
|
||||
}
|
||||
else if (other.empty)
|
||||
{
|
||||
// if other.empty = true, other.x/other.y may be uninitialized values,
|
||||
// so don't use them to update this->state
|
||||
}
|
||||
else
|
||||
{
|
||||
if (other.left.x < left.x)
|
||||
|
@ -0,0 +1 @@
|
||||
1
|
@ -0,0 +1,16 @@
|
||||
drop table if exists rate_test;
|
||||
drop table if exists rate_test2;
|
||||
|
||||
create table rate_test (timestamp UInt32, event UInt32) engine=Memory;
|
||||
insert into rate_test values (0,1000),(1,1001),(2,1002),(3,1003),(4,1004),(5,1005),(6,1006),(7,1007),(8,1008);
|
||||
|
||||
create table rate_test2 (timestamp UInt32, event UInt32) engine=Memory;
|
||||
|
||||
SELECT boundingRatioMerge(state) FROM (
|
||||
select boundingRatioState(timestamp, event) as state from rate_test
|
||||
UNION ALL
|
||||
SELECT boundingRatioState(timestamp, event) FROM rate_test2 WHERE 1=0
|
||||
);
|
||||
|
||||
drop table if exists rate_test;
|
||||
drop table if exists rate_test2;
|
Loading…
Reference in New Issue
Block a user