Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Yury-Fridlyand opened this issue Oct 31, 2022 · 0 comments · Fixed by #1025
Closed

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

Yury-Fridlyand opened this issue Oct 31, 2022 · 0 comments · Fixed by #1025
Labels

Comments

@Yury-Fridlyand
Copy link
Collaborator

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
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants