Skip to content

unnesting does not work on array column with fixed size #16672

@blacelle

Description

@blacelle

What happens?

In the context of #16670, I try to do SUM-aggregations of arrays by unnesting the arrays (given DuckDB does not enable arrays aggregations on a per-index basis).

Though, it appears unnest fails on a column with a pre-determined size. In this case, it fails with:

Binder Error: UNNEST() can only be applied to lists, structs and NULL
LINE 1: select unnest( doubles_fixed) from doubles_tab...

To Reproduce

CREATE TABLE doubles_table (doubles_dynamic DOUBLE[], doubles_fixed DOUBLE[2]);
INSERT INTO doubles_table VALUES ([1.2, 2.3], [1.2, 2.3]);
select unnest( doubles_dynamic) from doubles_table; <-- OK
select unnest( doubles_fixed) from doubles_table;   <-- KO

OS:

macOS

DuckDB Version:

1.2

DuckDB Client:

CLI

Hardware:

No response

Full Name:

Benoit Lacelle

Affiliation:

Solven

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?

Yes

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions