Update test with sample and prewhere.

This commit is contained in:
Nikolai Kochetov 2019-09-05 10:42:14 +03:00
parent 0d1846baab
commit e1e600b8b3

View File

@ -1,7 +1,7 @@
create table if not exists sample_prewhere (date Date, id Int32, time Int64) engine = MergeTree partition by date order by (id, time, intHash64(time)) sample by intHash64(time); create table if not exists sample_prewhere (date Date, id Int32, time Int64) engine = MergeTree partition by date order by (id, time, intHash64(time)) sample by intHash64(time);
insert into test.sample_prewhere values ('2019-01-01', 2, toDateTime('2019-07-20 00:00:01')); insert into sample_prewhere values ('2019-01-01', 2, toDateTime('2019-07-20 00:00:01'));
insert into test.sample_prewhere values ('2019-01-01', 1, toDateTime('2019-07-20 00:00:02')); insert into sample_prewhere values ('2019-01-01', 1, toDateTime('2019-07-20 00:00:02'));
insert into test.sample_prewhere values ('2019-01-02', 3, toDateTime('2019-07-20 00:00:03')); insert into sample_prewhere values ('2019-01-02', 3, toDateTime('2019-07-20 00:00:03'));
select id from remote('127.0.0.{1,3}', currentDatabase(), sample_prewhere) SAMPLE 1 where toDateTime(time) = '2019-07-20 00:00:00'; select id from remote('127.0.0.{1,3}', currentDatabase(), sample_prewhere) SAMPLE 1 where toDateTime(time) = '2019-07-20 00:00:00';