Skip to content

coalesce on RunEndEncoded column fails to plan #21918

@asubiotto

Description

@asubiotto

Describe the bug

coalesce(REE_column, literal) fails to plan when one argument is a RunEndEncoded column and another is a non-REE literal. The same failure occurs for any expression routed through type_union_resolution (UNION, NULLIF, CASE, etc.).

Function 'coalesce' user-defined coercion failed with: Execution error:
Fail to find the coerced type, errors: Execution error:
Expect to get struct but got RunEndEncoded("run_ends": non-null Int32, "values": Utf8).
No function matches the given name and argument types
'coalesce(RunEndEncoded("run_ends": non-null Int32, "values": Utf8), Utf8)'.

To Reproduce

CREATE TABLE ree_t AS
SELECT arrow_cast(c, 'RunEndEncoded("run_ends": non-null Int32, "values": Utf8)') AS ree_col
FROM (VALUES ('hello'), (NULL), ('world')) AS t(c);

SELECT coalesce(ree_col, '__null__') FROM ree_t;

Expected behavior

hello
__null__
world

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions