File: hugeint.test

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 (29 lines) | stat: -rw-r--r-- 755 bytes parent folder | download | duplicates (4)
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
# name: test/sql/function/list/aggregates/hugeint.test
# description: Test hugeint aggregates
# group: [aggregates]

statement ok
CREATE TABLE hugeints(h HUGEINT[])

statement ok
INSERT INTO hugeints VALUES ([NULL, 1, 2]), (NULL), ([]), ([NULL]), ([1, 2, 3])

query III
SELECT list_first(h), list_last(h), list_sum(h) FROM hugeints
----
NULL	2	3
NULL	NULL	NULL
NULL	NULL	NULL
NULL	NULL	NULL
1	3	6

statement ok
DELETE FROM hugeints

statement ok
INSERT INTO hugeints VALUES ([42.0, 1267650600228229401496703205376, -439847238974238975238975, '-12']);

query IIIII
SELECT list_min(h), list_max(h), list_sum(h), list_first(h), list_last(h) FROM hugeints;
----
-439847238974238975238975	1267650600228229401496703205376	1267650160380990427257727966431	42	-12