File: reduce_initial.test_slow

package info (click to toggle)
duckdb 1.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 299,196 kB
  • sloc: cpp: 865,414; ansic: 57,292; python: 18,871; sql: 12,663; lisp: 11,751; yacc: 7,412; lex: 1,682; sh: 747; makefile: 558
file content (38 lines) | stat: -rw-r--r-- 813 bytes parent folder | download | duplicates (3)
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