pub trait TakeFn<Array> {
// Required method
fn take(
&self,
array: &Array,
indices: &ArrayData,
) -> VortexResult<ArrayData>;
// Provided method
unsafe fn take_unchecked(
&self,
array: &Array,
indices: &ArrayData,
) -> VortexResult<ArrayData> { ... }
}
Required Methods§
Provided Methods§
Sourceunsafe fn take_unchecked(
&self,
array: &Array,
indices: &ArrayData,
) -> VortexResult<ArrayData>
unsafe fn take_unchecked( &self, array: &Array, indices: &ArrayData, ) -> VortexResult<ArrayData>
Create a new array by taking the values from the array
at the
given indices
.
§Safety
This take variant will not perform bounds checking on indices, so it is the caller’s
responsibility to ensure that the indices
are all valid for the provided array
.
Failure to do so could result in out of bounds memory access or UB.
Implementors§
impl TakeFn<BoolArray> for BoolEncoding
impl TakeFn<ChunkedArray> for ChunkedEncoding
impl TakeFn<ConstantArray> for ConstantEncoding
impl TakeFn<ExtensionArray> for ExtensionEncoding
impl TakeFn<NullArray> for NullEncoding
impl TakeFn<PrimitiveArray> for PrimitiveEncoding
impl TakeFn<SparseArray> for SparseEncoding
impl TakeFn<StructArray> for StructEncoding
impl TakeFn<VarBinArray> for VarBinEncoding
impl TakeFn<VarBinViewArray> for VarBinViewEncoding
Take involves creating a new array that references the old array, just with the given set of views.