mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 13:32:13 +00:00
Add a test for Buffer flushing (direct, background min/max time)
This commit is contained in:
parent
a9b1b36907
commit
2afa3cbaa3
10
tests/queries/0_stateless/01246_buffer_flush.reference
Normal file
10
tests/queries/0_stateless/01246_buffer_flush.reference
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
min
|
||||||
|
0
|
||||||
|
5
|
||||||
|
max
|
||||||
|
5
|
||||||
|
10
|
||||||
|
direct
|
||||||
|
20
|
||||||
|
drop
|
||||||
|
30
|
44
tests/queries/0_stateless/01246_buffer_flush.sql
Normal file
44
tests/queries/0_stateless/01246_buffer_flush.sql
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
drop table if exists data_01256;
|
||||||
|
drop table if exists buffer_01256;
|
||||||
|
|
||||||
|
create table data_01256 as system.numbers Engine=Memory();
|
||||||
|
|
||||||
|
select 'min';
|
||||||
|
create table buffer_01256 as system.numbers Engine=Buffer(currentDatabase(), data_01256, 1,
|
||||||
|
2, 100, /* time */
|
||||||
|
4, 100, /* rows */
|
||||||
|
1, 1e6 /* bytes */
|
||||||
|
);
|
||||||
|
insert into buffer_01256 select * from system.numbers limit 5;
|
||||||
|
select count() from data_01256;
|
||||||
|
-- sleep 2 (min time) + 1 (round up) + bias (1) = 4
|
||||||
|
select sleepEachRow(2) from numbers(2) FORMAT Null;
|
||||||
|
select count() from data_01256;
|
||||||
|
drop table buffer_01256;
|
||||||
|
|
||||||
|
select 'max';
|
||||||
|
create table buffer_01256 as system.numbers Engine=Buffer(currentDatabase(), data_01256, 1,
|
||||||
|
100, 2, /* time */
|
||||||
|
0, 100, /* rows */
|
||||||
|
0, 1e6 /* bytes */
|
||||||
|
);
|
||||||
|
insert into buffer_01256 select * from system.numbers limit 5;
|
||||||
|
select count() from data_01256;
|
||||||
|
-- sleep 2 (min time) + 1 (round up) + bias (1) = 4
|
||||||
|
select sleepEachRow(2) from numbers(2) FORMAT Null;
|
||||||
|
select count() from data_01256;
|
||||||
|
drop table buffer_01256;
|
||||||
|
|
||||||
|
select 'direct';
|
||||||
|
create table buffer_01256 as system.numbers Engine=Buffer(currentDatabase(), data_01256, 1,
|
||||||
|
100, 100, /* time */
|
||||||
|
0, 9, /* rows */
|
||||||
|
0, 1e6 /* bytes */
|
||||||
|
);
|
||||||
|
insert into buffer_01256 select * from system.numbers limit 10;
|
||||||
|
select count() from data_01256;
|
||||||
|
|
||||||
|
select 'drop';
|
||||||
|
insert into buffer_01256 select * from system.numbers limit 10;
|
||||||
|
drop table if exists buffer_01256;
|
||||||
|
select count() from data_01256;
|
Loading…
Reference in New Issue
Block a user