mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Function arrayLast added tests
This commit is contained in:
parent
6b9703446d
commit
fb179a45a1
18
tests/queries/0_stateless/02161_array_first_last.reference
Normal file
18
tests/queries/0_stateless/02161_array_first_last.reference
Normal file
@ -0,0 +1,18 @@
|
||||
ArrayFirst constant predicate
|
||||
0
|
||||
0
|
||||
1
|
||||
0
|
||||
ArrayFirst non constant predicate
|
||||
0
|
||||
2
|
||||
2
|
||||
ArrayLast constant predicate
|
||||
0
|
||||
0
|
||||
3
|
||||
0
|
||||
ArrayLast non constant predicate
|
||||
0
|
||||
3
|
||||
3
|
21
tests/queries/0_stateless/02161_array_first_last.sql
Normal file
21
tests/queries/0_stateless/02161_array_first_last.sql
Normal file
@ -0,0 +1,21 @@
|
||||
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, [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, [1, 2, 3]);
|
Loading…
Reference in New Issue
Block a user