Struct vortex::array::PrimitiveArray
source · pub struct PrimitiveArray { /* private fields */ }
Implementations§
source§impl PrimitiveArray
impl PrimitiveArray
pub fn new(buffer: Buffer, ptype: PType, validity: Validity) -> Self
pub fn from_vec<T: NativePType>(values: Vec<T>, validity: Validity) -> Self
pub fn from_nullable_vec<T: NativePType>(values: Vec<Option<T>>) -> Self
sourcepub fn from_bytes(bytes: Bytes, validity: Validity) -> Self
pub fn from_bytes(bytes: Bytes, validity: Validity) -> Self
Creates a new array of type U8
pub fn validity(&self) -> Validity
pub fn ptype(&self) -> PType
pub fn buffer(&self) -> &Buffer
pub fn maybe_null_slice<T: NativePType>(&self) -> &[T]
sourcepub fn into_maybe_null_slice<T: NativePType + ArrowNativeType>(self) -> Vec<T>
pub fn into_maybe_null_slice<T: NativePType + ArrowNativeType>(self) -> Vec<T>
Convert the array into a mutable vec of the given type. If possible, this will be zero-copy.
pub fn get_as_cast<T: NativePType>(&self, idx: usize) -> T
pub fn reinterpret_cast(&self, ptype: PType) -> Self
pub fn patch<P: AsPrimitive<usize>, T: NativePType + ArrowNativeType>( self, positions: &[P], values: &[T], ) -> VortexResult<Self>
pub fn into_buffer(self) -> Buffer
Trait Implementations§
source§impl AcceptArrayVisitor for PrimitiveArray
impl AcceptArrayVisitor for PrimitiveArray
fn accept(&self, visitor: &mut dyn ArrayVisitor) -> VortexResult<()>
source§impl<T: NativePType> ArrayAccessor<T> for PrimitiveArray
impl<T: NativePType> ArrayAccessor<T> for PrimitiveArray
source§fn with_iterator<F, R>(&self, f: F) -> VortexResult<R>
fn with_iterator<F, R>(&self, f: F) -> VortexResult<R>
Iterate over each element of the array, in-order. Read more
source§impl ArrayCompute for PrimitiveArray
impl ArrayCompute for PrimitiveArray
source§fn cast(&self) -> Option<&dyn CastFn>
fn cast(&self) -> Option<&dyn CastFn>
Implemented for arrays that can be casted to different types. Read more
source§fn compare(&self) -> Option<&dyn CompareFn>
fn compare(&self) -> Option<&dyn CompareFn>
Binary operator implementation for arrays against other arrays. Read more
source§fn fill_forward(&self) -> Option<&dyn FillForwardFn>
fn fill_forward(&self) -> Option<&dyn FillForwardFn>
Array function that returns new arrays a non-null value is repeated across runs of nulls. Read more
source§fn filter_indices(&self) -> Option<&dyn FilterIndicesFn>
fn filter_indices(&self) -> Option<&dyn FilterIndicesFn>
Filter indices based on a disjunctive normal form relational expression.
TODO(aduffy): remove this function and push implementation into vortex-datafusion.
source§fn scalar_at(&self) -> Option<&dyn ScalarAtFn>
fn scalar_at(&self) -> Option<&dyn ScalarAtFn>
Single item indexing on Vortex arrays. Read more
source§fn subtract_scalar(&self) -> Option<&dyn SubtractScalarFn>
fn subtract_scalar(&self) -> Option<&dyn SubtractScalarFn>
Broadcast subtraction of scalar from Vortex array. Read more
source§fn search_sorted(&self) -> Option<&dyn SearchSortedFn>
fn search_sorted(&self) -> Option<&dyn SearchSortedFn>
Perform a search over an ordered array. Read more
source§fn take(&self) -> Option<&dyn TakeFn>
fn take(&self) -> Option<&dyn TakeFn>
Take a set of indices from an array. This often forces allocations and decoding of
the receiver. Read more
source§impl ArrayStatisticsCompute for PrimitiveArray
impl ArrayStatisticsCompute for PrimitiveArray
source§fn compute_statistics(&self, stat: Stat) -> VortexResult<StatsSet>
fn compute_statistics(&self, stat: Stat) -> VortexResult<StatsSet>
Compute the requested statistic. Can return additional stats.
source§impl ArrayTrait for PrimitiveArray
impl ArrayTrait for PrimitiveArray
source§impl ArrayValidity for PrimitiveArray
impl ArrayValidity for PrimitiveArray
fn is_valid(&self, index: usize) -> bool
fn logical_validity(&self) -> LogicalValidity
source§impl ArrayVariants for PrimitiveArray
impl ArrayVariants for PrimitiveArray
fn as_primitive_array(&self) -> Option<&dyn PrimitiveArrayTrait>
fn as_null_array(&self) -> Option<&dyn NullArrayTrait>
fn as_null_array_unchecked(&self) -> &dyn NullArrayTrait
fn as_bool_array(&self) -> Option<&dyn BoolArrayTrait>
fn as_bool_array_unchecked(&self) -> &dyn BoolArrayTrait
fn as_primitive_array_unchecked(&self) -> &dyn PrimitiveArrayTrait
fn as_utf8_array(&self) -> Option<&dyn Utf8ArrayTrait>
fn as_utf8_array_unchecked(&self) -> &dyn Utf8ArrayTrait
fn as_binary_array(&self) -> Option<&dyn BinaryArrayTrait>
fn as_binary_array_unchecked(&self) -> &dyn BinaryArrayTrait
fn as_struct_array(&self) -> Option<&dyn StructArrayTrait>
fn as_struct_array_unchecked(&self) -> &dyn StructArrayTrait
fn as_list_array(&self) -> Option<&dyn ListArrayTrait>
fn as_list_array_unchecked(&self) -> &dyn ListArrayTrait
fn as_extension_array(&self) -> Option<&dyn ExtensionArrayTrait>
fn as_extension_array_unchecked(&self) -> &dyn ExtensionArrayTrait
source§impl AsArray for PrimitiveArray
impl AsArray for PrimitiveArray
fn as_array_ref(&self) -> &Array
source§impl CastFn for PrimitiveArray
impl CastFn for PrimitiveArray
source§impl Clone for PrimitiveArray
impl Clone for PrimitiveArray
source§fn clone(&self) -> PrimitiveArray
fn clone(&self) -> PrimitiveArray
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CompareFn for PrimitiveArray
impl CompareFn for PrimitiveArray
source§impl Debug for PrimitiveArray
impl Debug for PrimitiveArray
source§impl FillForwardFn for PrimitiveArray
impl FillForwardFn for PrimitiveArray
fn fill_forward(&self) -> VortexResult<Array>
source§impl FilterFn for PrimitiveArray
impl FilterFn for PrimitiveArray
source§impl FilterIndicesFn for PrimitiveArray
impl FilterIndicesFn for PrimitiveArray
fn filter_indices(&self, disjunction: &Disjunction) -> VortexResult<Array>
source§impl From<PrimitiveArray> for Array
impl From<PrimitiveArray> for Array
source§fn from(value: PrimitiveArray) -> Array
fn from(value: PrimitiveArray) -> Array
Converts to this type from the input type.
source§impl From<TypedArray<Primitive>> for PrimitiveArray
impl From<TypedArray<Primitive>> for PrimitiveArray
source§fn from(typed: TypedArray<Primitive>) -> Self
fn from(typed: TypedArray<Primitive>) -> Self
Converts to this type from the input type.
source§impl<T: NativePType> From<Vec<T>> for PrimitiveArray
impl<T: NativePType> From<Vec<T>> for PrimitiveArray
source§impl GetArrayMetadata for PrimitiveArray
impl GetArrayMetadata for PrimitiveArray
fn metadata(&self) -> Arc<dyn ArrayMetadata>
source§impl<'a> IntoArray for PrimitiveArray
impl<'a> IntoArray for PrimitiveArray
fn into_array(self) -> Array
source§impl IntoCanonical for PrimitiveArray
impl IntoCanonical for PrimitiveArray
fn into_canonical(self) -> VortexResult<Canonical>
source§impl ScalarAtFn for PrimitiveArray
impl ScalarAtFn for PrimitiveArray
source§impl SearchSortedFn for PrimitiveArray
impl SearchSortedFn for PrimitiveArray
fn search_sorted( &self, value: &Scalar, side: SearchSortedSide, ) -> VortexResult<SearchResult>
source§impl SliceFn for PrimitiveArray
impl SliceFn for PrimitiveArray
source§impl SubtractScalarFn for PrimitiveArray
impl SubtractScalarFn for PrimitiveArray
fn subtract_scalar(&self, to_subtract: &Scalar) -> VortexResult<Array>
source§impl TakeFn for PrimitiveArray
impl TakeFn for PrimitiveArray
source§impl TryFrom<&Array> for PrimitiveArray
impl TryFrom<&Array> for PrimitiveArray
source§impl TryFrom<Array> for PrimitiveArray
impl TryFrom<Array> for PrimitiveArray
impl PrimitiveArrayTrait for PrimitiveArray
Auto Trait Implementations§
impl !Freeze for PrimitiveArray
impl !RefUnwindSafe for PrimitiveArray
impl Send for PrimitiveArray
impl Sync for PrimitiveArray
impl Unpin for PrimitiveArray
impl !UnwindSafe for PrimitiveArray
Blanket Implementations§
source§impl<T> ArrayEncodingRef for Twhere
T: AsArray,
impl<T> ArrayEncodingRef for Twhere
T: AsArray,
fn encoding(&self) -> &'static dyn ArrayEncoding
source§impl<T> ArrayStatistics for Twhere
T: AsArray,
impl<T> ArrayStatistics for Twhere
T: AsArray,
fn statistics(&self) -> &dyn Statistics
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoArrayVariant for Twhere
T: IntoCanonical,
impl<T> IntoArrayVariant for Twhere
T: IntoCanonical,
fn into_null(self) -> Result<NullArray, VortexError>
fn into_bool(self) -> Result<BoolArray, VortexError>
fn into_primitive(self) -> Result<PrimitiveArray, VortexError>
fn into_struct(self) -> Result<StructArray, VortexError>
fn into_varbin(self) -> Result<VarBinArray, VortexError>
fn into_extension(self) -> Result<ExtensionArray, VortexError>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more