Comments (12)
Rustler now supports 128 bit integers (thanks for initiating that, @Munksgaard!):
I think we can consider this issue blocked until rustler does another release. Otherwise we'd have to go off their master branch, which probably isn't worth the headache since they seem to release regularly.
from explorer.
Seems like this has already been released with rustler 0.32.1
from explorer.
The update of Rustler to v0.32.1
has landed on main :)
from explorer.
(Carrying over some of my comment as well)
Polars does support a decimal datatype:
If we want to support it as well, the tricky part will be representing things in Elixir. I see two options:
I haven't played with the Decimal datatype in Polars or Arrow, so I don't know if it maps nicely to the Decimal
library's representation. But I have no objections to exploring either option (or some other thing I didn't think of).
from explorer.
There is a reference here: https://arrow.apache.org/docs/r/reference/data-type.html
The implementation is straight-forward, it is stored as a large integer, which we can easily convert to Decimal using Decimal.new/3
. If a list of Decimals is given as input, we will need to compute the scale, using Decimal.scale. And for precision, we can use the maximum one.
from explorer.
👍 I think I'm comfortable adding Decimal as a dep.
@Munksgaard PRs welcome! If you're not able to, then I can take a crack when I have some time.
from explorer.
One complication that I can see is that Decimal allows both NaN
and Infinity
as values, which we don't have representations for in Polars as far as I can tell.
from explorer.
Yes, we should raise when encoding those. We will already have to do a prepass converting all decimals into int::128 or int::256, so we can raise on NaN and Infinity.
from explorer.
@Munksgaard PRs welcome! If you're not able to, then I can take a crack when I have some time.
I would love to help out, but realistically I won't be able to contribute anything significant in the next couple of weeks :-(
from explorer.
I'm comfortable with Decimal
as a dep as well. It doesn't carry its own deps, pretty lightweight.
from explorer.
I had a crack at adding Decimal support and managed to add reading without too much trouble: alexpearce@709aa67
I found adding write support more challenging. It seems that Decimal support in polars-core isn't quite as mature as for other dtypes so write support requires a bit more work.
from explorer.
@alexpearce Feel free to open a PR. If you're still having trouble, we can discuss there why write support is more difficult.
from explorer.
Related Issues (20)
- Seeing `:nif_not_loaded` error for `Series.split/2` when mutating a dataframe HOT 1
- [Feature request] Add support for read_database in Polars backend. HOT 1
- Using `sort_by` with a grouped data frame doesn't respect `nils:` option HOT 1
- `{:datetime, :second}` dtype support HOT 2
- Add :streaming option to DataFrame.to_csv/3 HOT 1
- Exporting to CSV with a duration column returns an error
- Regression in `DataFrame.concat_rows/2` in v0.8.2 HOT 1
- Filter throwing undefined variable error HOT 1
- Error using is_finite and is_infinite within mutate HOT 1
- Explorer NIF broken on FreeBSD HOT 12
- Support Elixir built in Duration struct HOT 1
- Bug: Rounding Error in Tests HOT 1
- exposing the `fold` expressions from Polars HOT 7
- :nif_panicked "Chunk require all its arrays to have an equal number of rows" HOT 1
- Sorting an empty DataFrame results in a runtime Polars error HOT 1
- Performance of `DataFrame.new/2` on dataframes containing list columns HOT 7
- `Series.filter` should work inside `DataFrame.summarise` HOT 5
- Large memory usage when using `Explorer.Dataframe.concat_columns` on 30k (small) data frames. Memory leak? HOT 4
- [Not Issue] - Are the plans to use duckdb as an alternative backend? HOT 2
- Support streaming: true on collect HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from explorer.