Skip to content

No operation greater between Decimal(9, 2) and Float64 #22626

Closed

Description

@UnamedRus

Describe the bug
It's not possible to compare Decimal and Float values. But actually both of them point to some specific value on real number line, so we can compare and that wouldn't produce any precision loss.

How to reproduce
Clickhouse 21.5

SELECT toDecimal32('11.00', 2) > 1.

Query id: f2c1cba1-748e-42ea-83ac-e117b542d576


0 rows in set. Elapsed: 0.002 sec.

Received exception from server (version 21.5.1):
Code: 43. DB::Exception: Received from localhost:9000. DB::Exception: No operation greater between Decimal(9, 2) and Float64: While processing toDecimal32('11.00', 2) > 1..

Loosely related #5690

Activity

  1. added
    bug
    on Apr 4, 2021
  2. UnamedRus commented on Apr 4, 2021

    @UnamedRus
    ContributorAuthor

    Probably should be not a bug, but a feature.

  3. added
    st-accepted
    and removed
    bug
    on Apr 5, 2021
  4. added
    comp-decimal
    on Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-decimalfeaturest-accepted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions