ClickHouse/tests/queries/0_stateless/02161_array_first_last.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
798 B
MySQL
Raw Normal View History

2022-01-07 16:00:27 +00:00
SELECT 'ArrayFirst constant predicate';
SELECT arrayFirst(x -> 1, emptyArrayUInt8());
SELECT arrayFirst(x -> 0, emptyArrayUInt8());
SELECT arrayFirst(x -> 1, [1, 2, 3]);
SELECT arrayFirst(x -> 0, [1, 2, 3]);
SELECT 'ArrayFirst non constant predicate';
SELECT arrayFirst(x -> x >= 2, emptyArrayUInt8());
SELECT arrayFirst(x -> x >= 2, [1, 2, 3]);
2022-01-08 08:37:56 +00:00
SELECT arrayFirst(x -> x >= 2, materialize([1, 2, 3]));
2022-01-07 16:00:27 +00:00
SELECT 'ArrayLast constant predicate';
SELECT arrayLast(x -> 1, emptyArrayUInt8());
SELECT arrayLast(x -> 0, emptyArrayUInt8());
SELECT arrayLast(x -> 1, [1, 2, 3]);
SELECT arrayLast(x -> 0, [1, 2, 3]);
SELECT 'ArrayLast non constant predicate';
SELECT arrayLast(x -> x >= 2, emptyArrayUInt8());
SELECT arrayLast(x -> x >= 2, [1, 2, 3]);
2022-01-08 08:37:56 +00:00
SELECT arrayLast(x -> x >= 2, materialize([1, 2, 3]));