2018-04-23 03:30:28 +00:00
|
|
|
DROP TABLE IF EXISTS nested;
|
|
|
|
CREATE TABLE nested
|
|
|
|
(
|
|
|
|
column Nested
|
|
|
|
(
|
|
|
|
name String,
|
|
|
|
names Array(String),
|
|
|
|
types Array(Enum8('PU' = 1, 'US' = 2, 'OTHER' = 3))
|
|
|
|
)
|
|
|
|
) ENGINE = MergeTree ORDER BY tuple();
|
|
|
|
|
|
|
|
INSERT INTO nested VALUES (['Hello', 'World'], [['a'], ['b', 'c']], [['PU', 'US'], ['OTHER']]);
|
|
|
|
|
|
|
|
SELECT * FROM nested;
|
|
|
|
|
2018-04-23 03:32:53 +00:00
|
|
|
DETACH TABLE nested;
|
|
|
|
ATTACH TABLE nested;
|
|
|
|
|
|
|
|
SELECT * FROM nested;
|
|
|
|
|
2018-04-23 05:09:35 +00:00
|
|
|
INSERT INTO nested VALUES (['GoodBye'], [['1', '2']], [['PU', 'US', 'OTHER']]);
|
|
|
|
|
|
|
|
SELECT * FROM nested ORDER BY column.name;
|
|
|
|
OPTIMIZE TABLE nested PARTITION tuple() FINAL;
|
|
|
|
SELECT * FROM nested ORDER BY column.name;
|
|
|
|
|
|
|
|
DETACH TABLE nested;
|
|
|
|
ATTACH TABLE nested;
|
|
|
|
|
|
|
|
SELECT * FROM nested ORDER BY column.name;
|
|
|
|
|
2018-04-23 03:30:28 +00:00
|
|
|
|
|
|
|
DROP TABLE IF EXISTS nested;
|
|
|
|
CREATE TABLE nested
|
|
|
|
(
|
|
|
|
column Nested
|
|
|
|
(
|
|
|
|
name String,
|
|
|
|
names Array(String),
|
|
|
|
types Array(Enum8('PU' = 1, 'US' = 2, 'OTHER' = 3))
|
|
|
|
)
|
|
|
|
) ENGINE = Log;
|
|
|
|
|
|
|
|
INSERT INTO nested VALUES (['Hello', 'World'], [['a'], ['b', 'c']], [['PU', 'US'], ['OTHER']]);
|
|
|
|
|
|
|
|
SELECT * FROM nested;
|
|
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS nested;
|
|
|
|
CREATE TABLE nested
|
|
|
|
(
|
|
|
|
column Nested
|
|
|
|
(
|
|
|
|
name String,
|
|
|
|
names Array(String),
|
|
|
|
types Array(Enum8('PU' = 1, 'US' = 2, 'OTHER' = 3))
|
|
|
|
)
|
|
|
|
) ENGINE = TinyLog;
|
|
|
|
|
|
|
|
INSERT INTO nested VALUES (['Hello', 'World'], [['a'], ['b', 'c']], [['PU', 'US'], ['OTHER']]);
|
|
|
|
|
|
|
|
SELECT * FROM nested;
|
|
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS nested;
|
|
|
|
CREATE TABLE nested
|
|
|
|
(
|
|
|
|
column Nested
|
|
|
|
(
|
|
|
|
name String,
|
|
|
|
names Array(String),
|
|
|
|
types Array(Enum8('PU' = 1, 'US' = 2, 'OTHER' = 3))
|
|
|
|
)
|
|
|
|
) ENGINE = StripeLog;
|
|
|
|
|
|
|
|
INSERT INTO nested VALUES (['Hello', 'World'], [['a'], ['b', 'c']], [['PU', 'US'], ['OTHER']]);
|
|
|
|
|
|
|
|
SELECT * FROM nested;
|
|
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS nested;
|
|
|
|
CREATE TABLE nested
|
|
|
|
(
|
|
|
|
column Nested
|
|
|
|
(
|
|
|
|
name String,
|
|
|
|
names Array(String),
|
|
|
|
types Array(Enum8('PU' = 1, 'US' = 2, 'OTHER' = 3))
|
|
|
|
)
|
|
|
|
) ENGINE = Memory;
|
|
|
|
|
|
|
|
INSERT INTO nested VALUES (['Hello', 'World'], [['a'], ['b', 'c']], [['PU', 'US'], ['OTHER']]);
|
|
|
|
|
|
|
|
SELECT * FROM nested;
|
|
|
|
|
|
|
|
|
|
|
|
DROP TABLE nested;
|