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

Support DataType::Decimal(15, 2) in TPC-H benchmark #174

Closed
alamb opened this issue Apr 26, 2021 · 3 comments
Closed

Support DataType::Decimal(15, 2) in TPC-H benchmark #174

alamb opened this issue Apr 26, 2021 · 3 comments
Labels
datafusion Changes in the datafusion crate enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented Apr 26, 2021

Note: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-11536

Currently converting the Float64 to Decimal(15, 2) fails with:

Error: Plan("'Int64 - Decimal(15, 2)' can't be evaluated because there isn't a common type to coerce the types to")

FYI [~MikeSeddonAU]

@alamb alamb added the datafusion Changes in the datafusion crate label Apr 26, 2021
@liukun4515
Copy link
Contributor

@alamb this issue can be closed.
The cast/try_cast has been implemented.
We can cast float to decimal or decimal to float.

@liukun4515
Copy link
Contributor

❯ select cast(12.33 as decimal(10,2));
+----------------------------------------+
| CAST(Float64(12.33) AS Decimal(10, 2)) |
+----------------------------------------+
| 12.33                                  |
+----------------------------------------+
1 row in set. Query took 0.006 seconds.

@houqp
Copy link
Member

houqp commented Jan 27, 2022

🎉

@houqp houqp closed this as completed Jan 27, 2022
@alamb alamb added the enhancement New feature or request label Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants