Added test. [#CLICKHOUSE-3794]

This commit is contained in:
Nikolai Kochetov 2018-06-28 18:11:05 +03:00 committed by alexey-milovidov
parent acd6c8fafd
commit 29ef36a270
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,12 @@
[1,1,2,3,2,4]
[1,2,1,3,2,3]
[1,1,1,2,1,2]
[1,1,1,2,1,2]
[1,1,1,2,1,2]
[1,1,1,2,1,2]
[1,1,1,2,3,2,4,2,3]
[1,2,3,1,4,2,3,4,5]
[1,1,1,1,2,1,2,1,2]
[1,1,1,1,2,1,2,1,2]
[1,1,1,1,2,1,2,1,2]
[1,1,1,1,2,1,2,1,2]

View File

@ -0,0 +1,20 @@
drop table if exists test.tab;
create table test.tab (val UInt32, n Nested(x UInt8, y String)) engine = Memory;
insert into test.tab values (1, [1, 2, 1, 1, 2, 1], ['a', 'a', 'b', 'a', 'b', 'b']);
select arrayEnumerateUniq(n.x) from test.tab;
select arrayEnumerateUniq(n.y) from test.tab;
select arrayEnumerateUniq(n.x, n.y) from test.tab;
select arrayEnumerateUniq(arrayMap((a, b) -> (a, b), n.x, n.y)) from test.tab;
select arrayEnumerateUniq(arrayMap((a, b) -> (a, b), n.x, n.y), n.x) from test.tab;
select arrayEnumerateUniq(arrayMap((a, b) -> (a, b), n.x, n.y), arrayMap((a, b) -> (b, a), n.x, n.y)) from test.tab;
drop table test.tab;
create table test.tab (val UInt32, n Nested(x Nullable(UInt8), y String)) engine = Memory;
insert into test.tab values (1, [1, Null, 2, 1, 1, 2, 1, Null, Null], ['a', 'a', 'a', 'b', 'a', 'b', 'b', 'b', 'a']);
select arrayEnumerateUniq(n.x) from test.tab;
select arrayEnumerateUniq(n.y) from test.tab;
select arrayEnumerateUniq(n.x, n.y) from test.tab;
select arrayEnumerateUniq(arrayMap((a, b) -> (a, b), n.x, n.y)) from test.tab;
select arrayEnumerateUniq(arrayMap((a, b) -> (a, b), n.x, n.y), n.x) from test.tab;
select arrayEnumerateUniq(arrayMap((a, b) -> (a, b), n.x, n.y), arrayMap((a, b) -> (b, a), n.x, n.y)) from test.tab;