2020-11-23 09:06:59 +00:00
|
|
|
DROP TABLE IF EXISTS t;
|
|
|
|
DROP TABLE IF EXISTS d;
|
|
|
|
|
|
|
|
CREATE TABLE t (a String, b Int) ENGINE = TinyLog;
|
|
|
|
INSERT INTO t VALUES ('a', 0), ('a', 1), ('b', 0);
|
|
|
|
SELECT * FROM t;
|
|
|
|
|
|
|
|
SELECT '---';
|
|
|
|
CREATE TABLE d (a String, b Int) ENGINE = Distributed(test_shard_localhost, currentDatabase(), t);
|
2020-11-26 09:51:55 +00:00
|
|
|
SELECT DISTINCT b FROM (SELECT a, b FROM d GROUP BY a, b) order by b;
|
2020-11-23 09:06:59 +00:00
|
|
|
DROP TABLE d;
|
|
|
|
|
|
|
|
SELECT '---';
|
|
|
|
CREATE TABLE d (a String, b Int) ENGINE = Distributed(test_cluster_two_shards_localhost, currentDatabase(), t);
|
2020-11-26 09:51:55 +00:00
|
|
|
SELECT DISTINCT b FROM (SELECT a, b FROM d GROUP BY a, b) order by b;
|
2020-11-23 09:06:59 +00:00
|
|
|
DROP TABLE d;
|
|
|
|
|
|
|
|
DROP TABLE t;
|