Segmentation fault during PIVOTING table (CLI) using struct field #12328
Description
What happens?
There is some limitation or bug during pivoting table using struct type field.
I'm using the CLI. I would like to pivot a table, more than 6000 columns to produce.
Here is the result :
pivot donnees_csv on variable_id using first(donnee) group by id_niv,codzone;
85% ▕███████████████████████████████████████████████████
[1] 62343 segmentation fault duckdb tests.db
The donnee
field is a struct type.
To Reproduce
The table donnees_csv was materialized into a database like this :
create or replace table donnees_csv as (
select build_variable_id(codind,datefin::string) as variable_id,zonage as id_niv,codzone,valeur,
statut,{v:valeur,s:statut} as donnee
from read_csv('variables_donnees.csv', header=true) order by id_niv,codzone);
The build_variable_id
is a simple function : create or replace function build_variable_id(codind,datefin) as codind||'_'||replace(datefin,'-','_');
The segmentation fault is coming where pivoting like this :
pivot donnees_csv on variable_id using first(donnee) group by id_niv,codzone;
When i limit the size of the donnees_csv
table, it works fine. With the full size of the table, PIVOT has to produce 6000 columns.
Maybe important thing : it works when pivoting using another field than donnee
: donnee
is a struct type field, where using valeur
field (double type) all is fine.
OS:
MacOS
DuckDB Version:
10.0.3
DuckDB Client:
CLI
Full Name:
Frank Jardillier
Affiliation:
compas
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
No - I cannot easily share my data sets due to their large size
Did you include all code required to reproduce the issue?
- Yes, I have
Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?
- Yes, I have