1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
# name: test/sql/function/list/lambdas/reduce_initial.test_slow
# description: Test list_reduce function with an intial value on a larger data set
# group: [lambdas]
statement ok
SET lambda_syntax='DISABLE_SINGLE_ARROW'
# Large lists.
statement ok
CREATE TABLE large_lists AS SELECT range % 4 g, list(range) l, 100 AS initial FROM range(10000) GROUP BY range % 4;
query I
SELECT list_reduce(l, lambda x, y: least(x, y), initial) FROM large_lists ORDER BY g;
----
0
1
2
3
query I
SELECT list_reduce(l, lambda x, y: x + y, initial) FROM large_lists ORDER BY g;
----
12495100
12497600
12500100
12502600
# Large table.
statement ok
CREATE TABLE large_table AS
SELECT list_reduce(range(5000), lambda x, y: x + y, 1) AS l FROM range(1000);
query I
SELECT COUNT(*) FROM large_table WHERE l = 12497501;
----
1000
|