Skip to content

Recursive unnest misbehave if used together with another unnest on different column #11689

@duongcongtoai

Description

@duongcongtoai

Describe the bug

During the implementation of this issue I found another problem

Given this slt

query II
select unnest([1,2,3]), unnest(unnest([[1,2,3]]));

The output from Datafusion is

1 1
1 2
1 3

To Reproduce

No response

Expected behavior

Datafusion returns correct result set

1 1
2 2
3 3

Example in Duckdb

D select unnest([1,2,3]), unnest([[1,2,3]],recursive:=true);
┌──────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────┐
│ unnest(main.list_value(1, 2, 3)) │ unnest(main.list_value(main.list_value(1, 2, 3)), "recursive" := CAST('t' AS BOOLEAN)) │
│              int32               │                                         int32                                          │
├──────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┤
│                                1 │                                                                                      1 │
│                                2 │                                                                                      2 │
│                                3 │                                                                                      3 │
└──────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────┘

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