From a0d6593f90e6273437f14da1d594430a49339429 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 31 Jul 2020 00:07:51 +0300 Subject: [PATCH] Update tests --- .../0_stateless/00930_arrayIntersect.sql | 28 +++++++++---------- .../00932_array_intersect_bug.reference | 2 +- .../0_stateless/00932_array_intersect_bug.sql | 18 ++++++------ .../01323_add_scalars_in_time.reference | 4 +-- .../0_stateless/01323_add_scalars_in_time.sql | 2 +- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/tests/queries/0_stateless/00930_arrayIntersect.sql b/tests/queries/0_stateless/00930_arrayIntersect.sql index 64505fe4180..837e13b2c08 100644 --- a/tests/queries/0_stateless/00930_arrayIntersect.sql +++ b/tests/queries/0_stateless/00930_arrayIntersect.sql @@ -7,24 +7,24 @@ insert into array_intersect values ('2019-01-01', [1,2]); insert into array_intersect values ('2019-01-01', [1]); insert into array_intersect values ('2019-01-01', []); -select arrayIntersect(arr, [1,2]) from array_intersect order by arr; -select arrayIntersect(arr, []) from array_intersect order by arr; -select arrayIntersect([], arr) from array_intersect order by arr; -select arrayIntersect([1,2], arr) from array_intersect order by arr; -select arrayIntersect([1,2], [1,2,3,4]) from array_intersect order by arr; -select arrayIntersect([], []) from array_intersect order by arr; +select arraySort(arrayIntersect(arr, [1,2])) from array_intersect order by arr; +select arraySort(arrayIntersect(arr, [])) from array_intersect order by arr; +select arraySort(arrayIntersect([], arr)) from array_intersect order by arr; +select arraySort(arrayIntersect([1,2], arr)) from array_intersect order by arr; +select arraySort(arrayIntersect([1,2], [1,2,3,4])) from array_intersect order by arr; +select arraySort(arrayIntersect([], [])) from array_intersect order by arr; optimize table array_intersect; -select arrayIntersect(arr, [1,2]) from array_intersect order by arr; -select arrayIntersect(arr, []) from array_intersect order by arr; -select arrayIntersect([], arr) from array_intersect order by arr; -select arrayIntersect([1,2], arr) from array_intersect order by arr; -select arrayIntersect([1,2], [1,2,3,4]) from array_intersect order by arr; -select arrayIntersect([], []) from array_intersect order by arr; +select arraySort(arrayIntersect(arr, [1,2])) from array_intersect order by arr; +select arraySort(arrayIntersect(arr, [])) from array_intersect order by arr; +select arraySort(arrayIntersect([], arr)) from array_intersect order by arr; +select arraySort(arrayIntersect([1,2], arr)) from array_intersect order by arr; +select arraySort(arrayIntersect([1,2], [1,2,3,4])) from array_intersect order by arr; +select arraySort(arrayIntersect([], [])) from array_intersect order by arr; drop table if exists array_intersect; select '-'; -select arrayIntersect([-100], [156]); -select arrayIntersect([1], [257]); \ No newline at end of file +select arraySort(arrayIntersect([-100], [156])); +select arraySort(arrayIntersect([1], [257])); diff --git a/tests/queries/0_stateless/00932_array_intersect_bug.reference b/tests/queries/0_stateless/00932_array_intersect_bug.reference index 7ac5ecf7ac2..8772408bfbb 100644 --- a/tests/queries/0_stateless/00932_array_intersect_bug.reference +++ b/tests/queries/0_stateless/00932_array_intersect_bug.reference @@ -5,5 +5,5 @@ [2] [] [] -[3,1,2] +[1,2,3] [] diff --git a/tests/queries/0_stateless/00932_array_intersect_bug.sql b/tests/queries/0_stateless/00932_array_intersect_bug.sql index 6d9d2382ae1..fc9c03c6dcb 100644 --- a/tests/queries/0_stateless/00932_array_intersect_bug.sql +++ b/tests/queries/0_stateless/00932_array_intersect_bug.sql @@ -1,9 +1,9 @@ -SELECT arrayIntersect(['a', 'b', 'c'], ['a', 'a']); -SELECT arrayIntersect([1, 1], [2, 2]); -SELECT arrayIntersect([1, 1], [1, 2]); -SELECT arrayIntersect([1, 1, 1], [3], [2, 2, 2]); -SELECT arrayIntersect([1, 2], [1, 2], [2]); -SELECT arrayIntersect([1, 1], [2, 1], [2, 2], [1]); -SELECT arrayIntersect([]); -SELECT arrayIntersect([1, 2, 3]); -SELECT arrayIntersect([1, 1], [2, 1], [2, 2], [2, 2, 2]); +SELECT arraySort(arrayIntersect(['a', 'b', 'c'], ['a', 'a'])); +SELECT arraySort(arrayIntersect([1, 1], [2, 2])); +SELECT arraySort(arrayIntersect([1, 1], [1, 2])); +SELECT arraySort(arrayIntersect([1, 1, 1], [3], [2, 2, 2])); +SELECT arraySort(arrayIntersect([1, 2], [1, 2], [2])); +SELECT arraySort(arrayIntersect([1, 1], [2, 1], [2, 2], [1])); +SELECT arraySort(arrayIntersect([])); +SELECT arraySort(arrayIntersect([1, 2, 3])); +SELECT arraySort(arrayIntersect([1, 1], [2, 1], [2, 2], [2, 2, 2])); diff --git a/tests/queries/0_stateless/01323_add_scalars_in_time.reference b/tests/queries/0_stateless/01323_add_scalars_in_time.reference index 85d56962cdb..49e20d0fea8 100644 --- a/tests/queries/0_stateless/01323_add_scalars_in_time.reference +++ b/tests/queries/0_stateless/01323_add_scalars_in_time.reference @@ -1,2 +1,2 @@ -[0,3,2] id2 -[3,1,2] id1 +[0,2,3] id2 +[1,2,3] id1 diff --git a/tests/queries/0_stateless/01323_add_scalars_in_time.sql b/tests/queries/0_stateless/01323_add_scalars_in_time.sql index 9a71b0075d4..b49c2ef416e 100644 --- a/tests/queries/0_stateless/01323_add_scalars_in_time.sql +++ b/tests/queries/0_stateless/01323_add_scalars_in_time.sql @@ -11,7 +11,7 @@ INSERT INTO tags(id, seqs) VALUES ('id1', [1,2,3]), ('id2', [0,2,3]), ('id1', [1 WITH (SELECT [0, 1, 2, 3]) AS arr1 -SELECT arrayIntersect(argMax(seqs, create_time), arr1) AS common, id +SELECT arraySort(arrayIntersect(argMax(seqs, create_time), arr1)) AS common, id FROM tags WHERE id LIKE 'id%' GROUP BY id;