mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Added test with sample and final.
This commit is contained in:
parent
d3118f0a76
commit
6587a87267
@ -0,0 +1,8 @@
|
||||
count
|
||||
1000000
|
||||
count final
|
||||
666667
|
||||
count sample
|
||||
557632
|
||||
count sample final
|
||||
371758
|
14
dbms/tests/queries/0_stateless/01034_sample_final.sql
Normal file
14
dbms/tests/queries/0_stateless/01034_sample_final.sql
Normal 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;
|
Loading…
Reference in New Issue
Block a user