pub struct PrimitiveArray { /* private fields */ }
Implementations§
Source§impl PrimitiveArray
impl PrimitiveArray
pub fn new(buffer: Buffer, ptype: PType, validity: Validity) -> PrimitiveArray
pub fn from_vec<T>(values: Vec<T>, validity: Validity) -> PrimitiveArraywhere
T: NativePType,
pub fn from_nullable_vec<T>(values: Vec<Option<T>>) -> PrimitiveArraywhere
T: NativePType,
Sourcepub fn from_bytes(bytes: Bytes, validity: Validity) -> PrimitiveArray
pub fn from_bytes(bytes: Bytes, validity: Validity) -> PrimitiveArray
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>(&self) -> &[T]where
T: NativePType,
Sourcepub fn into_maybe_null_slice<T>(self) -> Vec<T>where
T: NativePType + ArrowNativeType,
pub fn into_maybe_null_slice<T>(self) -> Vec<T>where
T: NativePType + ArrowNativeType,
Convert the array into a mutable vec of the given type. If possible, this will be zero-copy.
pub fn get_as_cast<T>(&self, idx: usize) -> Twhere
T: NativePType,
pub fn reinterpret_cast(&self, ptype: PType) -> PrimitiveArray
pub fn patch<P, T>( self, positions: &[P], values: &[T], ) -> Result<PrimitiveArray, VortexError>
pub fn into_buffer(self) -> Buffer
Trait Implementations§
Source§impl AcceptArrayVisitor for PrimitiveArray
impl AcceptArrayVisitor for PrimitiveArray
fn accept(&self, visitor: &mut dyn ArrayVisitor) -> Result<(), VortexError>
Source§impl<T> Accessor<T> for PrimitiveArraywhere
T: NativePType,
impl<T> Accessor<T> for PrimitiveArraywhere
T: NativePType,
Source§impl<T> ArrayAccessor<T> for PrimitiveArraywhere
T: NativePType,
impl<T> ArrayAccessor<T> for PrimitiveArraywhere
T: NativePType,
Source§fn with_iterator<F, R>(&self, f: F) -> Result<R, VortexError>
fn with_iterator<F, R>(&self, f: F) -> Result<R, VortexError>
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<Result<Array, VortexError>>
fn compare( &self, other: &Array, operator: Operator, ) -> Option<Result<Array, VortexError>>
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§impl ArrayStatisticsCompute for PrimitiveArray
impl ArrayStatisticsCompute for PrimitiveArray
Source§fn compute_statistics(&self, stat: Stat) -> Result<StatsSet, VortexError>
fn compute_statistics(&self, stat: Stat) -> Result<StatsSet, VortexError>
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
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) -> Result<Array, VortexError>
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>) -> PrimitiveArray
fn from(typed: TypedArray<Primitive>) -> PrimitiveArray
Converts to this type from the input type.
Source§impl<T> From<Vec<T>> for PrimitiveArraywhere
T: NativePType,
impl<T> From<Vec<T>> for PrimitiveArraywhere
T: NativePType,
Source§fn from(values: Vec<T>) -> PrimitiveArray
fn from(values: Vec<T>) -> PrimitiveArray
Converts to this type from the input type.
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) -> Result<Canonical, VortexError>
Source§impl MaybeCompareFn for PrimitiveArray
impl MaybeCompareFn for PrimitiveArray
fn maybe_compare( &self, other: &Array, operator: Operator, ) -> Option<Result<Array, VortexError>>
Source§impl PrimitiveArrayTrait for PrimitiveArray
impl PrimitiveArrayTrait for PrimitiveArray
fn f32_accessor(&self) -> Option<Arc<dyn Accessor<f32>>>
fn f64_accessor(&self) -> Option<Arc<dyn Accessor<f64>>>
fn u8_accessor(&self) -> Option<Arc<dyn Accessor<u8>>>
fn u16_accessor(&self) -> Option<Arc<dyn Accessor<u16>>>
fn u32_accessor(&self) -> Option<Arc<dyn Accessor<u32>>>
fn u64_accessor(&self) -> Option<Arc<dyn Accessor<u64>>>
fn i8_accessor(&self) -> Option<Arc<dyn Accessor<i8>>>
fn i16_accessor(&self) -> Option<Arc<dyn Accessor<i16>>>
fn i32_accessor(&self) -> Option<Arc<dyn Accessor<i32>>>
fn i64_accessor(&self) -> Option<Arc<dyn Accessor<i64>>>
fn f16_accessor(&self) -> Option<Arc<dyn Accessor<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, ) -> Result<SearchResult, VortexError>
fn search_sorted_u64( &self, value: u64, side: SearchSortedSide, ) -> Result<SearchResult, VortexError>
Source§fn search_sorted_many(
&self,
values: &[Scalar],
sides: &[SearchSortedSide],
) -> Result<Vec<SearchResult>, VortexError>
fn search_sorted_many( &self, values: &[Scalar], sides: &[SearchSortedSide], ) -> Result<Vec<SearchResult>, VortexError>
Bulk search for many values.
fn search_sorted_u64_many( &self, values: &[u64], sides: &[SearchSortedSide], ) -> Result<Vec<SearchResult>, VortexError>
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) -> Result<Array, VortexError>
Source§impl TakeFn for PrimitiveArray
impl TakeFn for PrimitiveArray
Source§impl TryFrom<&Array> for PrimitiveArray
impl TryFrom<&Array> for PrimitiveArray
Source§type Error = VortexError
type Error = VortexError
The type returned in the event of a conversion error.
Source§fn try_from(
array: &Array,
) -> Result<PrimitiveArray, <PrimitiveArray as TryFrom<&Array>>::Error>
fn try_from( array: &Array, ) -> Result<PrimitiveArray, <PrimitiveArray as TryFrom<&Array>>::Error>
Performs the conversion.
Source§impl TryFrom<Array> for PrimitiveArray
impl TryFrom<Array> for PrimitiveArray
Source§type Error = VortexError
type Error = VortexError
The type returned in the event of a conversion error.
Source§fn try_from(
array: Array,
) -> Result<PrimitiveArray, <PrimitiveArray as TryFrom<Array>>::Error>
fn try_from( array: Array, ) -> Result<PrimitiveArray, <PrimitiveArray as TryFrom<Array>>::Error>
Performs the conversion.
Source§impl UnaryFn for PrimitiveArray
impl UnaryFn 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 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§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