From fc6140ade825c1e953a89efb9ab373deade2b934 Mon Sep 17 00:00:00 2001 From: hcz Date: Fri, 28 Jun 2019 11:55:22 +0800 Subject: [PATCH] Add tests --- dbms/tests/queries/0_stateless/00897_flatten.reference | 3 +++ dbms/tests/queries/0_stateless/00897_flatten.sql | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dbms/tests/queries/0_stateless/00897_flatten.reference b/dbms/tests/queries/0_stateless/00897_flatten.reference index 36b61d51056..6c1aa724070 100644 --- a/dbms/tests/queries/0_stateless/00897_flatten.reference +++ b/dbms/tests/queries/0_stateless/00897_flatten.reference @@ -8,3 +8,6 @@ [0,0,1,0,1,0,1,0,1] [0,0,1,0,1,0,1,0,1,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2] [0,0,1,0,1,0,1,0,1,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3] +[1,2,3,4,5,6,7,8] +[] +[] diff --git a/dbms/tests/queries/0_stateless/00897_flatten.sql b/dbms/tests/queries/0_stateless/00897_flatten.sql index 344db389bac..fae7ae55f31 100644 --- a/dbms/tests/queries/0_stateless/00897_flatten.sql +++ b/dbms/tests/queries/0_stateless/00897_flatten.sql @@ -1,3 +1,6 @@ SELECT flatten(arrayJoin([[[1, 2, 3], [4, 5]], [[6], [7, 8]]])); -SELECT flatten(arrayJoin([[[[]], [[1], [], [2, 3]]], [[[4]]]])); +SELECT arrayFlatten(arrayJoin([[[[]], [[1], [], [2, 3]]], [[[4]]]])); SELECT flatten(arrayMap(x -> arrayMap(x -> arrayMap(x -> range(x), range(x)), range(x)), range(number))) FROM numbers(6); +SELECT arrayFlatten(arrayJoin([[[1, 2, 3], [4, 5]], [[6], [7, 8]]])); +SELECT flatten([[[]]]); +SELECT arrayFlatten([]);