Skip to content

between with NULL literals does not work: can't be evaluated because there isn't a common type to coerce the types to #1193

Closed
@alamb

Description

@alamb

Reproducer:

> select 5 between null and 10 as foo from foo;
Plan("'Int64 >= Utf8' can't be evaluated because there isn't a common type to coerce the types to")
> select 5 between 5 and null as foo from foo;
Plan("'Int64 <= Utf8' can't be evaluated because there isn't a common type to coerce the types to")
> select null between 5 and null as foo;
Plan("'Utf8 >= Int64' can't be evaluated because there isn't a common type to coerce the types to")

The correct output is null

I think the solution will likely be to teach Expr::Between about type coercion (as is done in BinaryExpr and function calls) once coercion knows about the null type (and that it can be cast to any other type). See #1184 for more details

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdatafusionChanges in the datafusion crate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions