ClickHouse/dbms/tests/queries/0_stateless/00952_insert_into_distributed_with_materialized_column.sql
2019-06-07 17:59:41 +03:00

16 lines
566 B
SQL

DROP TABLE IF EXISTS local_00952;
DROP TABLE IF EXISTS distributed_00952;
CREATE TABLE local_00952 (date Date, value Date MATERIALIZED toDate('2017-08-01')) ENGINE = MergeTree(date, date, 8192);
CREATE TABLE distributed_00952 AS local_00952 ENGINE = Distributed('test_shard_localhost', currentDatabase(), local_00952, rand());
SET insert_distributed_sync=1;
INSERT INTO distributed_00952 VALUES ('2018-08-01');
SELECT * FROM distributed_00952;
SELECT * FROM local_00952;
SELECT date, value FROM local_00952;
DROP TABLE distributed_00952;
DROP TABLE local_00952;