Closed
Description
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