Skip to content

Regression: Coercion stopped working for coalesce on a dictionary column #9925

@alamb

Description

@alamb

Describe the bug

coalesce on a dictionary column worked on 36.0.0 but does not in 37.0.0

To Reproduce

It works in 3.6.0

DataFusion CLI v36.0.0

❯ create table test as values (arrow_cast('foo', 'Dictionary(Int32, Utf8)')), (null);
0 rows in set. Query took 0.035 seconds.

❯ select  coalesce(column1, 'none_set') from test;
+-----------------------------------------+
| coalesce(test.column1,Utf8("none_set")) |
+-----------------------------------------+
| foo                                     |
| none_set                                |
+-----------------------------------------+
2 rows in set. Query took 0.018 seconds.

Fails in 37.0.0:

DataFusion CLI v37.0.0
❯ create table test as values (arrow_cast('foo', 'Dictionary(Int32, Utf8)')), (null);
0 row(s) fetched.
Elapsed 0.021 seconds.

❯ select  coalesce(column1, 'none_set') from test;
Error during planning: No function matches the given name and argument types 'coalesce(Dictionary(Int32, Utf8), Utf8)'. You might need to add explicit type casts.
	Candidate functions:
coalesce(CoercibleT, .., CoercibleT)

Expected behavior

Should get the same answer as 36.0.0

Additional context

Maybe related to #9459

Kudos to @btasker for reporting this internally ❤

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionSomething that used to work no longer does

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions