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 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], values_validity: Validity, ) -> 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> Accessor<T> for PrimitiveArray
impl<T: NativePType> Accessor<T> for PrimitiveArray
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,
other: &Array,
operator: Operator,
) -> Option<VortexResult<Array>>
fn compare( &self, other: &Array, operator: Operator, ) -> Option<VortexResult<Array>>
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 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§fn filter(&self) -> Option<&dyn FilterFn>
fn filter(&self) -> Option<&dyn FilterFn>
Filtering function on arrays of predicates. Read more
Source§fn and(&self) -> Option<&dyn AndFn>
fn and(&self) -> Option<&dyn AndFn>
Perform an Arrow-style boolean AND operation over two arrays Read more
Source§fn and_kleene(&self) -> Option<&dyn AndFn>
fn and_kleene(&self) -> Option<&dyn AndFn>
Perform a Kleene-style boolean AND operation over two arrays 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 AsRef<Array> for PrimitiveArray
impl AsRef<Array> for PrimitiveArray
Source§impl BinaryFn for PrimitiveArray
impl BinaryFn for PrimitiveArray
fn binary<I: NativePType, U: NativePType, O: NativePType, F: Fn(I, U) -> O>( &self, rhs: Array, binary_fn: F, ) -> VortexResult<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 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 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 IntoArray for PrimitiveArray
impl 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 MaybeCompareFn for PrimitiveArray
impl MaybeCompareFn for PrimitiveArray
fn maybe_compare( &self, other: &Array, operator: Operator, ) -> Option<VortexResult<Array>>
Source§impl PrimitiveArrayTrait for PrimitiveArray
impl PrimitiveArrayTrait for PrimitiveArray
fn f32_accessor(&self) -> Option<AccessorRef<f32>>
fn f64_accessor(&self) -> Option<AccessorRef<f64>>
fn u8_accessor(&self) -> Option<AccessorRef<u8>>
fn u16_accessor(&self) -> Option<AccessorRef<u16>>
fn u32_accessor(&self) -> Option<AccessorRef<u32>>
fn u64_accessor(&self) -> Option<AccessorRef<u64>>
fn i8_accessor(&self) -> Option<AccessorRef<i8>>
fn i16_accessor(&self) -> Option<AccessorRef<i16>>
fn i32_accessor(&self) -> Option<AccessorRef<i32>>
fn i64_accessor(&self) -> Option<AccessorRef<i64>>
fn ptype(&self) -> PType
fn f16_accessor(&self) -> Option<AccessorRef<f16>>
fn u8_iter(&self) -> Option<VectorizedArrayIter<u8>>
fn u16_iter(&self) -> Option<VectorizedArrayIter<u16>>
fn u32_iter(&self) -> Option<VectorizedArrayIter<u32>>
fn u64_iter(&self) -> Option<VectorizedArrayIter<u64>>
fn i8_iter(&self) -> Option<VectorizedArrayIter<i8>>
fn i16_iter(&self) -> Option<VectorizedArrayIter<i16>>
fn i32_iter(&self) -> Option<VectorizedArrayIter<i32>>
fn i64_iter(&self) -> Option<VectorizedArrayIter<i64>>
fn f16_iter(&self) -> Option<VectorizedArrayIter<f16>>
fn f32_iter(&self) -> Option<VectorizedArrayIter<f32>>
fn f64_iter(&self) -> Option<VectorizedArrayIter<f64>>
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>
fn search_sorted_u64( &self, value: u64, side: SearchSortedSide, ) -> VortexResult<SearchResult>
Source§fn search_sorted_many(
&self,
values: &[Scalar],
sides: &[SearchSortedSide],
) -> VortexResult<Vec<SearchResult>>
fn search_sorted_many( &self, values: &[Scalar], sides: &[SearchSortedSide], ) -> VortexResult<Vec<SearchResult>>
Bulk search for many values.
fn search_sorted_u64_many( &self, values: &[u64], sides: &[SearchSortedSide], ) -> VortexResult<Vec<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
Source§impl UnaryFn for PrimitiveArray
impl UnaryFn for PrimitiveArray
fn unary<I: NativePType, O: NativePType, F: Fn(I) -> O>( &self, unary_fn: F, ) -> VortexResult<Array>
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 T
impl<T> ArrayEncodingRef for T
fn encoding(&self) -> &'static dyn ArrayEncoding
Source§impl<T> ArrayStatistics for T
impl<T> ArrayStatistics for T
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
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_varbinview(self) -> Result<VarBinViewArray, 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