Skip to content

flatten should be single-step, not recursive  #13757

Open
@findepi

Description

@findepi

Describe the bug

per #13706 the list functions are modeled after DuckDB1

per https://duckdb.org/docs/sql/functions/list.html#flattenlist_of_lists, flatten should flatten one level, not recursive

To Reproduce

query ???
select flatten(arrow_cast(make_array([[1.1]], [[2.2]], [[3.3], [4.4]]), 'LargeList(LargeList(LargeList(Float64)))'));
----
[1.1, 2.2, 3.3, 4.4]

Expected behavior

query ???
select flatten(arrow_cast(make_array([[1.1]], [[2.2]], [[3.3], [4.4]]), 'LargeList(LargeList(LargeList(Float64)))'));
----
[[1.1], [2.2], [3.3], [4.4]]

Additional context

No response

Footnotes

  1. i would prefer a more established point of reference with close alignment to the SQL standard, but this issue is not about this

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