Skip to content

Decimals and Floats can not be used in expressions without explicit type cast #9881

@alex-zaitsev

Description

@alex-zaitsev

(you don't have to strictly follow this form)

Describe the bug
Decimals and floats can not be used in expressions without explicit conversion.

How to reproduce

SELECT toDecimal32(3, 5) * 1.2

Received exception from server (version 20.3.2):
Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: Illegal types Float64 and Decimal(9, 2) of arguments of function multiply. 

Expected behavior

Perform implicit type conversion to the proper data type, as it works with floats and integers. E.g. 'SELECT toDecimal32(3, 5) + 1' works fine.

In real applications we can expect Decimal columns and expressions over them.

Metadata

Metadata

Assignees

Labels

comp-decimalDecimal datatype semantics, arithmetic, casting, serialization.unfinished code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions