-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement DECIMAL type #122
Comments
@alamb any idea about how to start this? |
Hi @j-a-m-l, I see arrow-rs has supported |
@j-a-m-l I think a @xudong963 has a good point that Arrow already includes some support for DecimalArrays. A good place to start then be to write some tests in sql.rs that create a TableProvider with a column of The typical order I would try is something like
Writing those tests is probably a good way to figure out how to plumb through the support in DataFusion -- I would also recommend doing it in that order (projection, filter, sort, grouping / aggregation) |
Thanks @xudong963 and @alamb |
Is there any plan for implementation |
Hi @j-a-m-l, do you have time to work on this? |
I want to take some tasks to support the decimal data type in the datafusion. |
I don't know of any plans other than what is on this ticket. As I mentioned in #122 (comment) I think figuring out what subtasks are needed (by writing some tests and trying out what works / doesn't work) is a good first step |
No, @xudong963. Currently I don't have enough time to do that, and I'll probably focus first on fixing other issues that I've found, such as #1173. |
Here are several other issues that seem to be related to DECIMAL: |
Thanks for the feedback. |
In order to implement decimal in datafusion, we should ref some data type rules, like spark data type and type coercion. |
yep, Now I just try to support some simple demo code for decimal. For example function(min,max) and just Projection the column with decimal data type (without any operation and functions) The rule of conversion in the above two files should be refactored, If we want to align the behavior with PG database exactly. In the PG database, decimal and other numerical data type can be convert to each other, and in some case the varchar also can be convert to a decimal data type. In my opinion, we can support some simple and right rules first, and support other complex features later. For example, In the What do you think about? @alamb |
I think this is a great idea -- taking stock / consolidating the existing coercion logic might be a good place to start (before you try to extend it to support Decimal) |
Thanks to the work of @rdettai @xudong963 and others, we are making great progress here Also added #122 as @liukun4515 is actively working on it cc @hntd187
Thanks to the work of @rdettai @xudong963 and others, we are making great progress here Also added #122 as @liukun4515 is actively working on it cc @hntd187
Note: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-10818
The TPC-H benchmarks correctly specify that all MONEY columns are DECIMAL type (precision and scale are not specified). We currently use
DataType::Float64
which is much lighter than a true Decimal type.To be a valid benchmark we need to ensure we support the same precision as the reference implementation.
The text was updated successfully, but these errors were encountered: