Added test with sample and final.

This commit is contained in:
Nikolai Kochetov 2019-11-25 16:09:44 +03:00
parent d3118f0a76
commit 6587a87267
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,8 @@
count
1000000
count final
666667
count sample
557632
count sample final
371758

View File

@ -0,0 +1,14 @@
drop table if exists sample_final;
create table sample_final (CounterID UInt32, EventDate Date, EventTime DateTime, UserID UInt64, Sign Int8) engine = CollapsingMergeTree(Sign) order by (CounterID, EventDate, intHash32(UserID), EventTime) sample by intHash32(UserID);
insert into sample_final select number / (8192 * 4), toDate('2019-01-01'), toDateTime('2019-01-01 00:00:01') + number, number / (8192 * 2), number % 3 = 1 ? -1 : 1 from numbers(1000000);
select 'count';
select count() from sample_final;
select 'count final';
select count() from sample_final final;
select 'count sample';
select count() from sample_final sample 1/2;
select 'count sample final';
select count() from sample_final final sample 1/2;
drop table if exists sample_final;