Skip to content

coercion between decimal and other types lacking, compared to other numeric types #3479

@kmitchener

Description

@kmitchener

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
From test sql::expr::binary_mathematical_operator_with_null_lt

select null + 1::decimal;
Plan("'Null + Decimal128(38, 10)' can't be evaluated because there isn't a common type to coerce the types to")

or (from the "test_string_concat_operator" test):

select 'a' || 1.1::decimal;
Plan("'Utf8 || Decimal128(38, 10)' can't be evaluated because there isn't a common type to coerce the types to")

Expected behavior
A clear and concise description of what you expected to happen.

It should work like floats do:

select null + 1::float;
+-----------------+
| NULL + Int64(1) |
+-----------------+
|                 |
+-----------------+
1 row in set. Query took 0.005 seconds.
select 'a' || 1.1;
+---------------------------+
| Utf8("a") || Float64(1.1) |
+---------------------------+
| a1.1                      |
+---------------------------+
1 row in set. Query took 0.003 seconds.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions