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:
It should then be possible to do something like (likely encapsulated in a nicer interface)
fn cow_builder(col: ArrayRef) -> Int32Builder {
let col: Arc<Int32Array> = downcast_array(col).unwrap();
let col: Int32Array = Arc::try_unwrap(col).unwrap_or_else(|_| col.as_ref().clone());
col.into_builder()
}
Additional context
Arrow2 recently merged a form of support for this.
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:
BuffertoMutableBufferlikely usingArc::try_unwrapT: Arrayto their corresponding builder, i.e.PrimitiveArray::into_builderArrayReftoArc<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.