Skip to content

Unnest query does not allow one expression being referenced multiple times #11198

Closed
@duongcongtoai

Description

@duongcongtoai

Describe the bug

Given this slt

statement ok
CREATE TABLE unnest_table
AS VALUES
    ([1,2,3])
;

select unnest(column1), unnest(column1) + 1 from unnest_table;

Datafusion throws error

External error: query failed: DataFusion error: Error during planning: Projections require unique expression names but the expression "unnest_table.column1 AS unnest(unnest_table.column1)" at position 0 and "unnest_table.column1 AS unnest(unnest_table.column1)" at position 1 have the same name. Consider aliasing ("AS") one of them.

To Reproduce

No response

Expected behavior

unnest(expr) can be referenced multiple times within select statement

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions