mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
22 lines
798 B
SQL
22 lines
798 B
SQL
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]);
|
|
SELECT arrayFirst(x -> x >= 2, materialize([1, 2, 3]));
|
|
|
|
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]);
|
|
SELECT arrayLast(x -> x >= 2, materialize([1, 2, 3]));
|