mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Update tests
This commit is contained in:
parent
c491b2c153
commit
a0d6593f90
@ -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]);
|
||||
select arraySort(arrayIntersect([-100], [156]));
|
||||
select arraySort(arrayIntersect([1], [257]));
|
||||
|
@ -5,5 +5,5 @@
|
||||
[2]
|
||||
[]
|
||||
[]
|
||||
[3,1,2]
|
||||
[1,2,3]
|
||||
[]
|
||||
|
@ -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]));
|
||||
|
@ -1,2 +1,2 @@
|
||||
[0,3,2] id2
|
||||
[3,1,2] id1
|
||||
[0,2,3] id2
|
||||
[1,2,3] id1
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user