mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
This commit is contained in:
parent
564cd01c64
commit
d8f96bf297
20
tests/queries/0_stateless/03120_analyzer_dist_join.reference
Normal file
20
tests/queries/0_stateless/03120_analyzer_dist_join.reference
Normal file
@ -0,0 +1,20 @@
|
||||
localhost 9000 0 0 0
|
||||
localhost 9000 0 0 0
|
||||
9 1
|
||||
10 2
|
||||
11 2
|
||||
9 1
|
||||
10 2
|
||||
11 2
|
||||
9 1
|
||||
10 2
|
||||
11 2
|
||||
9 1
|
||||
10 2
|
||||
11 2
|
||||
9 1
|
||||
10 2
|
||||
11 2
|
||||
9 1
|
||||
10 2
|
||||
11 2
|
75
tests/queries/0_stateless/03120_analyzer_dist_join.sql
Normal file
75
tests/queries/0_stateless/03120_analyzer_dist_join.sql
Normal file
@ -0,0 +1,75 @@
|
||||
-- https://github.com/ClickHouse/ClickHouse/issues/8547
|
||||
SET allow_experimental_analyzer=1;
|
||||
SET distributed_foreground_insert=1;
|
||||
|
||||
CREATE TABLE a1_replicated ON CLUSTER test_shard_localhost (
|
||||
day Date,
|
||||
id UInt32
|
||||
)
|
||||
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{database}/a1_replicated', '1_replica')
|
||||
ORDER BY tuple();
|
||||
|
||||
CREATE TABLE a1 (
|
||||
day Date,
|
||||
id UInt32
|
||||
)
|
||||
ENGINE = Distributed('test_shard_localhost', currentDatabase(), a1_replicated, id);
|
||||
|
||||
CREATE TABLE b1_replicated ON CLUSTER test_shard_localhost (
|
||||
day Date,
|
||||
id UInt32
|
||||
)
|
||||
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{database}/b1_replicated', '1_replica')
|
||||
ORDER BY tuple();
|
||||
|
||||
CREATE TABLE b1 (
|
||||
day Date,
|
||||
id UInt32
|
||||
)
|
||||
ENGINE = Distributed('test_shard_localhost', currentDatabase(), b1_replicated, id);
|
||||
|
||||
|
||||
INSERT INTO a1 (day, id) VALUES ('2019-01-01', 9), ('2019-01-01', 10), ('2019-01-02', 10), ('2019-01-01', 11);
|
||||
INSERT INTO b1 (day, id) VALUES ('2019-01-01', 9), ('2019-01-01', 10), ('2019-01-02', 11), ('2019-01-01', 11);
|
||||
|
||||
|
||||
SET distributed_product_mode='local';
|
||||
|
||||
SELECT id, count()
|
||||
FROM a1 AS a1
|
||||
LEFT JOIN b1 AS b1 ON a1.id = b1.id
|
||||
GROUP BY id
|
||||
ORDER BY id;
|
||||
|
||||
SELECT id, count()
|
||||
FROM a1 a1
|
||||
LEFT JOIN (SELECT id FROM b1 b1) b1 ON a1.id = b1.id
|
||||
GROUP BY id
|
||||
ORDER BY id;
|
||||
|
||||
SELECT id, count()
|
||||
FROM (SELECT id FROM a1) a1
|
||||
LEFT JOIN (SELECT id FROM b1) b1 ON a1.id = b1.id
|
||||
GROUP BY id
|
||||
ORDER BY id;
|
||||
|
||||
|
||||
SET distributed_product_mode='global';
|
||||
|
||||
SELECT id, count()
|
||||
FROM a1 AS a1
|
||||
LEFT JOIN b1 AS b1 ON a1.id = b1.id
|
||||
GROUP BY id
|
||||
ORDER BY id;
|
||||
|
||||
SELECT id, count()
|
||||
FROM a1 a1
|
||||
LEFT JOIN (SELECT id FROM b1 b1) b1 ON a1.id = b1.id
|
||||
GROUP BY id
|
||||
ORDER BY id;
|
||||
|
||||
SELECT id, count()
|
||||
FROM (SELECT id FROM a1) a1
|
||||
LEFT JOIN (SELECT id FROM b1) b1 ON a1.id = b1.id
|
||||
GROUP BY id
|
||||
ORDER BY id;
|
Loading…
Reference in New Issue
Block a user