Skip to content

[BUG] Casting a DOUBLE as a FLOAT truncates all decimal digits #998

Closed

Description

@Yury-Fridlyand

What is the bug?

Casting a DOUBLE as a FLOAT truncates all decimal digits

How can one reproduce the bug?

opensearchsql> select typeof(3.14);
fetched rows / total rows = 1/1
+----------------+
| typeof(3.14)   |
|----------------|
| DOUBLE         |
+----------------+
opensearchsql> select CAST(3.14 as FLOAT);
fetched rows / total rows = 1/1
+-----------------------+
| CAST(3.14 as FLOAT)   |
|-----------------------|
| 3.0                   |
+-----------------------+

What is the expected behavior?

Casted value should have as many digits as possible.

What is your host/environment?

2.x @ 99cebe3

Do you have any additional context?

Opened on behalf of @kylepbit

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

    SQLbi-toolingbugdata-correctness

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions