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

Request to Memmap Arrow IPC files on disk #5153

Closed
comath opened this issue Nov 30, 2023 · 3 comments · Fixed by #5249
Closed

Request to Memmap Arrow IPC files on disk #5153

comath opened this issue Nov 30, 2023 · 3 comments · Fixed by #5249
Assignees
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog

Comments

@comath
Copy link
Contributor

comath commented Nov 30, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I have machine learning dataset that exceed my system's ram which I access in a random pattern. I currently split the data into a flat f32 array written to the disk, and a set of parquet files. This is awkward and requires complex glue code.

Describe the solution you'd like
I'd like to use a memmap like this: https://huggingface.co/docs/datasets/about_arrow

Describe alternatives you've considered
Switching to another format. rkvy works, but is not nearly as interoperable.

Additional context

@comath comath added the enhancement Any new improvement worthy of a entry in the changelog label Nov 30, 2023
@tustvold
Copy link
Contributor

tustvold commented Nov 30, 2023

I believe this should already be possible if you create a Buffer from an external allocation and them feed this into the IPC decoder. I'm aware some people have done something similar in the past

@comath
Copy link
Contributor Author

comath commented Nov 30, 2023

I thought that was the case, but couldn't find a way to do that. The public function that reads record batches in the IPC crate needs a lot of boilerplate to adequately read an IPC file. The functions in the flight crate requires you go through a few hoops. The simplest pair is this read and write pair.

I implemented it using the IPC file reader code here.

Did I miss something?

@alamb alamb changed the title Request to Memmap IPC files on disk Request to Memmap Arrow IPC files on disk Dec 6, 2023
tustvold added a commit to tustvold/arrow-rs that referenced this issue Dec 6, 2023
@tustvold tustvold self-assigned this Dec 8, 2023
tustvold added a commit that referenced this issue Dec 8, 2023
* Blockwise IO in IPC FileReader (#5153)

* Docs

* Clippy

* Update arrow-ipc/src/reader.rs

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

---------

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@tustvold tustvold added the arrow Changes to the arrow crate label Jan 5, 2024
@tustvold
Copy link
Contributor

tustvold commented Jan 5, 2024

label_issue.py automatically added labels {'arrow'} from #5165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate enhancement Any new improvement worthy of a entry in the changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants