File: pivot_struct_aggregate.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 (23 lines) | stat: -rw-r--r-- 923 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
# name: test/sql/pivot/pivot_struct_aggregate.test
# description: Issue #12328: Segmentation fault during PIVOTING table (CLI) using struct field
# group: [pivot]

statement ok
PRAGMA enable_verification

statement ok
create table donnees_csv as select {'year': i::varchar, 'month': i::varchar} AS donnee, i%5 as variable_id, i%10 id_niv from range(1000) t(i);

query IIIIII
pivot donnees_csv on variable_id using first(donnee) group by id_niv order by all;
----
0	{'year': 0, 'month': 0}	NULL	NULL	NULL	NULL
1	NULL	{'year': 1, 'month': 1}	NULL	NULL	NULL
2	NULL	NULL	{'year': 2, 'month': 2}	NULL	NULL
3	NULL	NULL	NULL	{'year': 3, 'month': 3}	NULL
4	NULL	NULL	NULL	NULL	{'year': 4, 'month': 4}
5	{'year': 5, 'month': 5}	NULL	NULL	NULL	NULL
6	NULL	{'year': 6, 'month': 6}	NULL	NULL	NULL
7	NULL	NULL	{'year': 7, 'month': 7}	NULL	NULL
8	NULL	NULL	NULL	{'year': 8, 'month': 8}	NULL
9	NULL	NULL	NULL	NULL	{'year': 9, 'month': 9}