2015-04-08 21:27:35 +00:00
|
|
|
DROP TABLE IF EXISTS test.alter;
|
|
|
|
|
|
|
|
CREATE TABLE test.alter (d Date DEFAULT toDate('2015-01-01'), n Nested(x String)) ENGINE = MergeTree(d, d, 8192);
|
|
|
|
|
|
|
|
INSERT INTO test.alter (`n.x`) VALUES (['Hello', 'World']);
|
|
|
|
|
|
|
|
SELECT * FROM test.alter;
|
|
|
|
SELECT * FROM test.alter ARRAY JOIN n;
|
|
|
|
SELECT * FROM test.alter ARRAY JOIN n WHERE n.x LIKE '%Hello%';
|
|
|
|
|
|
|
|
ALTER TABLE test.alter ADD COLUMN n.y Array(UInt64);
|
|
|
|
|
|
|
|
SELECT * FROM test.alter;
|
|
|
|
SELECT * FROM test.alter ARRAY JOIN n;
|
|
|
|
SELECT * FROM test.alter ARRAY JOIN n WHERE n.x LIKE '%Hello%';
|
|
|
|
|
2015-04-09 00:37:08 +00:00
|
|
|
INSERT INTO test.alter (`n.x`) VALUES (['Hello2', 'World2']);
|
2015-04-08 21:27:35 +00:00
|
|
|
|
2015-04-09 00:37:08 +00:00
|
|
|
SELECT * FROM test.alter ORDER BY n.x;
|
|
|
|
SELECT * FROM test.alter ARRAY JOIN n ORDER BY n.x;
|
|
|
|
SELECT * FROM test.alter ARRAY JOIN n WHERE n.x LIKE '%Hello%' ORDER BY n.x;
|
2015-04-08 21:27:35 +00:00
|
|
|
|
|
|
|
OPTIMIZE TABLE test.alter;
|
|
|
|
|
|
|
|
SELECT * FROM test.alter;
|
|
|
|
SELECT * FROM test.alter ARRAY JOIN n;
|
|
|
|
SELECT * FROM test.alter ARRAY JOIN n WHERE n.x LIKE '%Hello%';
|
|
|
|
|
|
|
|
DROP TABLE test.alter;
|