-
Notifications
You must be signed in to change notification settings - Fork 853
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
Copy-On-Write Support to Support Mutating/Updating Arrays in Place #1981
Comments
Related arrow2 code: Example https://github.com/jorgecarleitao/arrow2/blob/main/examples/cow.rs#L23 Looks like it was added by @jorgecarleitao in jorgecarleitao/arrow2#1042 (which was a bit hard to find as it is described in terms of the implementation rather than the end user API change) 👍 |
Instead of copying-on-write (or maybe in addition to), how would we feel about an If we had that, we could have |
I think that is a separate feature, would you mind creating a new issue along with the intended use-case? I suspect it concerns implementing some sort of append only memtable, something I have thoughts on having implemented something similar for IOx (spoiler mem copies are far from the bottleneck). |
@tustvold @alamb @andygrove I filed an issue with PoC implementation: #3142 |
For COW, the high-level outline I think we have corresponding implementation now. Is there anything I miss? |
Theoretically it might be nice to provide |
For |
Sorry I meant into_builder for ByteArray |
🎉 thank you @viirya -- cc @avantgardnerio |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Certain use-cases may benefit from being able to mutate arrays in place, without copying them. Fortunately we have most of the pieces to support this, it just requires some plumbing work.
Describe the solution you'd like
A high-level outline can be found below:
Buffer
toMutableBuffer
likely usingArc::try_unwrap
T: Array
to their corresponding builder, i.e.PrimitiveArray::into_builder
ArrayRef
toArc<T>
- https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=abb7fcf97e33ba83d44b17f6c89e8f0bIt should then be possible to do something like (likely encapsulated in a nicer interface)
Additional context
Arrow2 recently merged a form of support for this.
The text was updated successfully, but these errors were encountered: