Skip to content

array_distinct fails when getting null as list #13961

@rluvaton

Description

@rluvaton

Describe the bug

When having array_distinct on null, the query fails

To Reproduce

Run the following in datafusion-cli

select array_distinct(a) from values ([1, 2, 3]), ([1, 3, 1]), (null) as X(a);

Internal error: UDF returned a different number of rows than expected. Expected: 3, Got: 2.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

Expected behavior

To not fail and return the correct result

Additional context

I'll create PR to fix this week

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