mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
fix as comment
This commit is contained in:
parent
347c24e6f3
commit
c4062de047
@ -65,6 +65,8 @@ struct AggregateFunctionBoundingRatioData
|
||||
}
|
||||
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
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
1
|
||||
1
|
||||
1
|
||||
1.5
|
||||
1.5
|
||||
1.5
|
||||
|
@ -1,19 +1,10 @@
|
||||
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);
|
||||
|
||||
select 1.0 = boundingRatio(timestamp, event) from rate_test;
|
||||
|
||||
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_test2;
|
||||
create table rate_test2 (uid UInt32 default 1,timestamp DateTime, event UInt32) engine=Memory;
|
||||
insert into rate_test2(timestamp, event) values ('2018-01-01 01:01:01',1001),('2018-01-01 01:01:02',1002),('2018-01-01 01:01:03',1003),('2018-01-01 01:01:04',1004),('2018-01-01 01:01:05',1005),('2018-01-01 01:01:06',1006),('2018-01-01 01:01:07',1007),('2018-01-01 01:01:08',1008);
|
||||
|
@ -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