Added test for multidimensional columns [#CLICKHOUSE-2838].

This commit is contained in:
Alexey Milovidov 2017-12-03 11:23:34 +03:00
parent 903dc680bb
commit 7b447bc1e4
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,9 @@
1 [['Hello','World'],['Goodbye'],[]]
1 [['Hello','World'],['Goodbye'],[]] ('',[],(0,'0000-00-00'))
0 [] ('Hello',['World',NULL],(123,'2000-01-01'))
1 [['Hello','World'],['Goodbye'],[]] ('',[],(0,'0000-00-00'))
0 [] ('Hello',['World',NULL],(123,'2000-01-01'))
1 [['Hello','World'],['Goodbye'],[]] ('Hello',['World',NULL],(123,'2000-01-01'))
1 [['Hello','World'],['Goodbye'],[]] ('Hello',['World',NULL],(123,'2000-01-01'))
1 [['Hello','World'],['Goodbye'],[]] ('Hello',['World',NULL],(123,'2000-01-01'))
1 [['Hello','World'],['Goodbye'],[]] ('Hello',['World',NULL],(123,'2000-01-01'))

View File

@ -0,0 +1,36 @@
SET experimental_allow_extended_storage_definition_syntax = 1;
DROP TABLE IF EXISTS test.multidimensional;
CREATE TABLE test.multidimensional (x UInt64, arr Array(Array(String))) ENGINE = MergeTree ORDER BY x;
INSERT INTO test.multidimensional VALUES (1, [['Hello', 'World'], ['Goodbye'], []]);
SELECT * FROM test.multidimensional;
ALTER TABLE test.multidimensional ADD COLUMN t Tuple(String, Array(Nullable(String)), Tuple(UInt32, Date));
INSERT INTO test.multidimensional (t) VALUES (('Hello', ['World', NULL], (123, '2000-01-01')));
SELECT * FROM test.multidimensional ORDER BY t;
OPTIMIZE TABLE test.multidimensional;
SELECT * FROM test.multidimensional ORDER BY t;
DROP TABLE test.multidimensional;
CREATE TABLE test.multidimensional (x UInt64, arr Array(Array(String)), t Tuple(String, Array(Nullable(String)), Tuple(UInt32, Date))) ENGINE = Memory;
INSERT INTO test.multidimensional VALUES (1, [['Hello', 'World'], ['Goodbye'], []], ('Hello', ['World', NULL], (123, '2000-01-01')));
SELECT * FROM test.multidimensional ORDER BY t;
DROP TABLE test.multidimensional;
CREATE TABLE test.multidimensional (x UInt64, arr Array(Array(String)), t Tuple(String, Array(Nullable(String)), Tuple(UInt32, Date))) ENGINE = TinyLog;
INSERT INTO test.multidimensional VALUES (1, [['Hello', 'World'], ['Goodbye'], []], ('Hello', ['World', NULL], (123, '2000-01-01')));
SELECT * FROM test.multidimensional ORDER BY t;
DROP TABLE test.multidimensional;
CREATE TABLE test.multidimensional (x UInt64, arr Array(Array(String)), t Tuple(String, Array(Nullable(String)), Tuple(UInt32, Date))) ENGINE = StripeLog;
INSERT INTO test.multidimensional VALUES (1, [['Hello', 'World'], ['Goodbye'], []], ('Hello', ['World', NULL], (123, '2000-01-01')));
SELECT * FROM test.multidimensional ORDER BY t;
DROP TABLE test.multidimensional;
CREATE TABLE test.multidimensional (x UInt64, arr Array(Array(String)), t Tuple(String, Array(Nullable(String)), Tuple(UInt32, Date))) ENGINE = Log;
INSERT INTO test.multidimensional VALUES (1, [['Hello', 'World'], ['Goodbye'], []], ('Hello', ['World', NULL], (123, '2000-01-01')));
SELECT * FROM test.multidimensional ORDER BY t;
DROP TABLE test.multidimensional;