Initial commit

This commit is contained in:
hughshen
2020-06-04 22:14:50 +08:00
commit cf5569e03c
7 changed files with 1394 additions and 0 deletions

18
example.sql Normal file
View File

@@ -0,0 +1,18 @@
CREATE TABLE test
(
test_date DateTime,
random_int UInt32
) ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/test', '{replica}')
PARTITION BY toYYYYMM(test_date)
ORDER BY (test_date);
CREATE TABLE test_all (
test_date DateTime,
random_int UInt32
) ENGINE = Distributed('ck_cluster', 'default', 'test', random_int);
INSERT INTO test_all VALUES ('2020-01-01 01:01:01', 1);
INSERT INTO test_all VALUES ('2020-02-02 02:02:02', 2);
-- select * from system.clusters
-- select hostName(), * from test_all