ClickHouse/dbms/tests/queries/0_stateless/01102_distributed_local_in_bug.sql
Artem Zuikov adca27cb45
Fix PREWHERE with distributed IN (#9871)
fix PREWHERE with distributed IN (local mode)
2020-03-26 12:07:10 +03:00

25 lines
780 B
SQL

DROP TABLE IF EXISTS hits;
DROP TABLE IF EXISTS visits;
DROP TABLE IF EXISTS hits_layer;
DROP TABLE IF EXISTS visits_layer;
CREATE TABLE visits(StartDate Date) ENGINE MergeTree ORDER BY(StartDate);
CREATE TABLE hits(EventDate Date, WatchID UInt8) ENGINE MergeTree ORDER BY(EventDate);
CREATE TABLE visits_layer(StartDate Date) ENGINE Distributed(test_cluster_two_shards_localhost, currentDatabase(), 'visits');
CREATE TABLE hits_layer(EventDate Date, WatchID UInt8) ENGINE Distributed(test_cluster_two_shards_localhost, currentDatabase(), 'hits');
SET distributed_product_mode = 'local';
SELECT 0 FROM hits_layer AS hl
PREWHERE WatchID IN
(
SELECT 0 FROM visits_layer AS vl
)
WHERE 0;
DROP TABLE hits;
DROP TABLE visits;
DROP TABLE hits_layer;
DROP TABLE visits_layer;