ClickHouse/tests/queries/0_stateless/00588_shard_distributed_prewhere.sql

18 lines
722 B
MySQL
Raw Normal View History

2021-09-12 12:35:27 +00:00
-- Tags: distributed
2019-06-03 17:36:27 +00:00
DROP TABLE IF EXISTS mergetree_00588;
DROP TABLE IF EXISTS distributed_00588;
2018-03-01 07:18:15 +00:00
2019-06-03 17:36:27 +00:00
CREATE TABLE mergetree_00588 (x UInt64, s String) ENGINE = MergeTree ORDER BY x;
INSERT INTO mergetree_00588 VALUES (1, 'hello'), (2, 'world');
2018-03-01 07:18:15 +00:00
2019-06-03 17:36:27 +00:00
SELECT * FROM mergetree_00588 PREWHERE x = 1 WHERE s LIKE '%l%' ORDER BY x, s;
SELECT * FROM remote('127.0.0.{1,2,3}', currentDatabase(), mergetree_00588) PREWHERE x = 1 WHERE s LIKE '%l%' ORDER BY x, s;
2018-03-01 07:18:15 +00:00
2019-06-03 17:36:27 +00:00
CREATE TABLE distributed_00588 AS mergetree_00588 ENGINE = Distributed(test_shard_localhost, currentDatabase(), mergetree_00588);
2018-03-01 07:18:15 +00:00
2019-06-03 17:36:27 +00:00
SELECT * FROM distributed_00588 PREWHERE x = 1 WHERE s LIKE '%l%' ORDER BY x, s;
2018-03-01 07:18:15 +00:00
2019-06-03 17:36:27 +00:00
DROP TABLE mergetree_00588;
DROP TABLE distributed_00588;