Added test for Log, TinyLog, StripeLog tables with Nullable types [#CLICKHOUSE-4].

This commit is contained in:
Alexey Milovidov 2017-04-23 11:29:38 +03:00
parent aa2cd20823
commit 3788c3d3dd
2 changed files with 190 additions and 0 deletions

View File

@ -0,0 +1,150 @@
0 \N []
1 1 [NULL]
2 \N [NULL,1]
3 \N [NULL,1,NULL]
4 4 [NULL,1,NULL,3]
5 \N [NULL,1,NULL,3,NULL]
6 \N [NULL,1,NULL,3,NULL,5]
7 7 [NULL,1,NULL,3,NULL,5,NULL]
8 \N [NULL,1,NULL,3,NULL,5,NULL,7]
9 \N [NULL,1,NULL,3,NULL,5,NULL,7,NULL]
0
1
2
3
4
5
6
7
8
9
\N
1
\N
\N
4
\N
\N
7
\N
\N
[]
[NULL]
[NULL,1]
[NULL,1,NULL]
[NULL,1,NULL,3]
[NULL,1,NULL,3,NULL]
[NULL,1,NULL,3,NULL,5]
[NULL,1,NULL,3,NULL,5,NULL]
[NULL,1,NULL,3,NULL,5,NULL,7]
[NULL,1,NULL,3,NULL,5,NULL,7,NULL]
0 []
1 [NULL]
2 [NULL,1]
3 [NULL,1,NULL]
4 [NULL,1,NULL,3]
5 [NULL,1,NULL,3,NULL]
6 [NULL,1,NULL,3,NULL,5]
7 [NULL,1,NULL,3,NULL,5,NULL]
8 [NULL,1,NULL,3,NULL,5,NULL,7]
9 [NULL,1,NULL,3,NULL,5,NULL,7,NULL]
0 \N []
1 1 [NULL]
2 \N [NULL,1]
3 \N [NULL,1,NULL]
4 4 [NULL,1,NULL,3]
5 \N [NULL,1,NULL,3,NULL]
6 \N [NULL,1,NULL,3,NULL,5]
7 7 [NULL,1,NULL,3,NULL,5,NULL]
8 \N [NULL,1,NULL,3,NULL,5,NULL,7]
9 \N [NULL,1,NULL,3,NULL,5,NULL,7,NULL]
0
1
2
3
4
5
6
7
8
9
\N
1
\N
\N
4
\N
\N
7
\N
\N
[]
[NULL]
[NULL,1]
[NULL,1,NULL]
[NULL,1,NULL,3]
[NULL,1,NULL,3,NULL]
[NULL,1,NULL,3,NULL,5]
[NULL,1,NULL,3,NULL,5,NULL]
[NULL,1,NULL,3,NULL,5,NULL,7]
[NULL,1,NULL,3,NULL,5,NULL,7,NULL]
0 []
1 [NULL]
2 [NULL,1]
3 [NULL,1,NULL]
4 [NULL,1,NULL,3]
5 [NULL,1,NULL,3,NULL]
6 [NULL,1,NULL,3,NULL,5]
7 [NULL,1,NULL,3,NULL,5,NULL]
8 [NULL,1,NULL,3,NULL,5,NULL,7]
9 [NULL,1,NULL,3,NULL,5,NULL,7,NULL]
0 \N []
1 1 [NULL]
2 \N [NULL,1]
3 \N [NULL,1,NULL]
4 4 [NULL,1,NULL,3]
5 \N [NULL,1,NULL,3,NULL]
6 \N [NULL,1,NULL,3,NULL,5]
7 7 [NULL,1,NULL,3,NULL,5,NULL]
8 \N [NULL,1,NULL,3,NULL,5,NULL,7]
9 \N [NULL,1,NULL,3,NULL,5,NULL,7,NULL]
0
1
2
3
4
5
6
7
8
9
\N
1
\N
\N
4
\N
\N
7
\N
\N
[]
[NULL]
[NULL,1]
[NULL,1,NULL]
[NULL,1,NULL,3]
[NULL,1,NULL,3,NULL]
[NULL,1,NULL,3,NULL,5]
[NULL,1,NULL,3,NULL,5,NULL]
[NULL,1,NULL,3,NULL,5,NULL,7]
[NULL,1,NULL,3,NULL,5,NULL,7,NULL]
0 []
1 [NULL]
2 [NULL,1]
3 [NULL,1,NULL]
4 [NULL,1,NULL,3]
5 [NULL,1,NULL,3,NULL]
6 [NULL,1,NULL,3,NULL,5]
7 [NULL,1,NULL,3,NULL,5,NULL]
8 [NULL,1,NULL,3,NULL,5,NULL,7]
9 [NULL,1,NULL,3,NULL,5,NULL,7,NULL]

View File

@ -0,0 +1,40 @@
DROP TABLE IF EXISTS test.nullable;
CREATE TABLE test.nullable (s String, ns Nullable(String), narr Array(Nullable(UInt64))) ENGINE = Log;
INSERT INTO test.nullable SELECT toString(number), number % 3 = 1 ? toString(number) : NULL, arrayMap(x -> x % 2 = 1 ? x : NULL, range(number)) FROM system.numbers LIMIT 10;
SELECT * FROM test.nullable ORDER BY s;
SELECT s FROM test.nullable ORDER BY s;
SELECT ns FROM test.nullable ORDER BY s;
SELECT narr FROM test.nullable ORDER BY s;
SELECT s, narr FROM test.nullable ORDER BY s;
INSERT INTO test.nullable SELECT toString(number), number % 3 = 1 ? toString(number) : NULL, arrayMap(x -> x % 2 = 1 ? x : NULL, range(number)) FROM system.numbers LIMIT 10, 10;
DROP TABLE IF EXISTS test.nullable;
CREATE TABLE test.nullable (s String, ns Nullable(String), narr Array(Nullable(UInt64))) ENGINE = TinyLog;
INSERT INTO test.nullable SELECT toString(number), number % 3 = 1 ? toString(number) : NULL, arrayMap(x -> x % 2 = 1 ? x : NULL, range(number)) FROM system.numbers LIMIT 10;
SELECT * FROM test.nullable ORDER BY s;
SELECT s FROM test.nullable ORDER BY s;
SELECT ns FROM test.nullable ORDER BY s;
SELECT narr FROM test.nullable ORDER BY s;
SELECT s, narr FROM test.nullable ORDER BY s;
INSERT INTO test.nullable SELECT toString(number), number % 3 = 1 ? toString(number) : NULL, arrayMap(x -> x % 2 = 1 ? x : NULL, range(number)) FROM system.numbers LIMIT 10, 10;
DROP TABLE IF EXISTS test.nullable;
CREATE TABLE test.nullable (s String, ns Nullable(String), narr Array(Nullable(UInt64))) ENGINE = StripeLog;
INSERT INTO test.nullable SELECT toString(number), number % 3 = 1 ? toString(number) : NULL, arrayMap(x -> x % 2 = 1 ? x : NULL, range(number)) FROM system.numbers LIMIT 10;
SELECT * FROM test.nullable ORDER BY s;
SELECT s FROM test.nullable ORDER BY s;
SELECT ns FROM test.nullable ORDER BY s;
SELECT narr FROM test.nullable ORDER BY s;
SELECT s, narr FROM test.nullable ORDER BY s;
INSERT INTO test.nullable SELECT toString(number), number % 3 = 1 ? toString(number) : NULL, arrayMap(x -> x % 2 = 1 ? x : NULL, range(number)) FROM system.numbers LIMIT 10, 10;
DROP TABLE test.nullable;