pub struct SparseArray { /* private fields */ }
Implementations§
Source§impl SparseArray
impl SparseArray
pub fn try_new( indices: Array, values: Array, len: usize, fill_value: ScalarValue, ) -> VortexResult<Self>
pub fn indices_offset(&self) -> usize
pub fn values(&self) -> Array
pub fn indices(&self) -> Array
pub fn fill_value(&self) -> &ScalarValue
pub fn fill_scalar(&self) -> Scalar
Sourcepub fn resolved_indices(&self) -> Vec<usize>
pub fn resolved_indices(&self) -> Vec<usize>
Return indices as a vector of usize with the indices_offset applied.
Trait Implementations§
Source§impl AcceptArrayVisitor for SparseArray
impl AcceptArrayVisitor for SparseArray
fn accept(&self, visitor: &mut dyn ArrayVisitor) -> VortexResult<()>
Source§impl ArrayCompute for SparseArray
impl ArrayCompute for SparseArray
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 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 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 subtract_scalar(&self) -> Option<&dyn SubtractScalarFn>
fn subtract_scalar(&self) -> Option<&dyn SubtractScalarFn>
Broadcast subtraction of scalar from Vortex array. 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 SparseArray
impl ArrayStatisticsCompute for SparseArray
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 SparseArray
impl ArrayTrait for SparseArray
Source§impl ArrayValidity for SparseArray
impl ArrayValidity for SparseArray
fn is_valid(&self, index: usize) -> bool
fn logical_validity(&self) -> LogicalValidity
Source§impl ArrayVariants for SparseArray
impl ArrayVariants for SparseArray
Sparse arrays support all DTypes
fn as_null_array(&self) -> Option<&dyn NullArrayTrait>
fn as_bool_array(&self) -> Option<&dyn BoolArrayTrait>
fn as_primitive_array(&self) -> Option<&dyn PrimitiveArrayTrait>
fn as_utf8_array(&self) -> Option<&dyn Utf8ArrayTrait>
fn as_binary_array(&self) -> Option<&dyn BinaryArrayTrait>
fn as_struct_array(&self) -> Option<&dyn StructArrayTrait>
fn as_list_array(&self) -> Option<&dyn ListArrayTrait>
fn as_extension_array(&self) -> Option<&dyn ExtensionArrayTrait>
fn as_null_array_unchecked(&self) -> &dyn NullArrayTrait
fn as_bool_array_unchecked(&self) -> &dyn BoolArrayTrait
fn as_primitive_array_unchecked(&self) -> &dyn PrimitiveArrayTrait
fn as_utf8_array_unchecked(&self) -> &dyn Utf8ArrayTrait
fn as_binary_array_unchecked(&self) -> &dyn BinaryArrayTrait
fn as_struct_array_unchecked(&self) -> &dyn StructArrayTrait
fn as_list_array_unchecked(&self) -> &dyn ListArrayTrait
fn as_extension_array_unchecked(&self) -> &dyn ExtensionArrayTrait
Source§impl AsRef<Array> for SparseArray
impl AsRef<Array> for SparseArray
Source§impl BoolArrayTrait for SparseArray
impl BoolArrayTrait for SparseArray
Source§fn invert(&self) -> VortexResult<Array>
fn invert(&self) -> VortexResult<Array>
Return a new inverted version of this array. Read more
Source§fn maybe_null_indices_iter(&self) -> Box<dyn Iterator<Item = usize>>
fn maybe_null_indices_iter(&self) -> Box<dyn Iterator<Item = usize>>
An iterator over the sorted indices of set values in the underlying boolean array
good to array with low number of set values. Read more
Source§fn maybe_null_slices_iter(&self) -> Box<dyn Iterator<Item = (usize, usize)>>
fn maybe_null_slices_iter(&self) -> Box<dyn Iterator<Item = (usize, usize)>>
An iterator over the sorted disjoint contiguous range of set values in the underlying boolean
array good for arrays with only long runs of set values. Read more
fn true_count(&self) -> usize
Source§impl Clone for SparseArray
impl Clone for SparseArray
Source§fn clone(&self) -> SparseArray
fn clone(&self) -> SparseArray
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 SparseArray
impl Debug for SparseArray
Source§impl ExtensionArrayTrait for SparseArray
impl ExtensionArrayTrait for SparseArray
Source§impl FilterFn for SparseArray
impl FilterFn for SparseArray
Source§impl From<SparseArray> for Array
impl From<SparseArray> for Array
Source§fn from(value: SparseArray) -> Array
fn from(value: SparseArray) -> Array
Converts to this type from the input type.
Source§impl From<TypedArray<Sparse>> for SparseArray
impl From<TypedArray<Sparse>> for SparseArray
Source§fn from(typed: TypedArray<Sparse>) -> Self
fn from(typed: TypedArray<Sparse>) -> Self
Converts to this type from the input type.
Source§impl GetArrayMetadata for SparseArray
impl GetArrayMetadata for SparseArray
fn metadata(&self) -> Arc<dyn ArrayMetadata>
Source§impl IntoArray for SparseArray
impl IntoArray for SparseArray
fn into_array(self) -> Array
Source§impl IntoCanonical for SparseArray
impl IntoCanonical for SparseArray
fn into_canonical(self) -> VortexResult<Canonical>
Source§impl PrimitiveArrayTrait for SparseArray
impl PrimitiveArrayTrait for SparseArray
fn ptype(&self) -> PType
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 f16_accessor(&self) -> Option<AccessorRef<f16>>
fn f32_accessor(&self) -> Option<AccessorRef<f32>>
fn f64_accessor(&self) -> Option<AccessorRef<f64>>
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 SparseArray
impl ScalarAtFn for SparseArray
Source§impl SearchSortedFn for SparseArray
impl SearchSortedFn for SparseArray
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 SparseArray
impl SliceFn for SparseArray
Source§impl StructArrayTrait for SparseArray
impl StructArrayTrait for SparseArray
Source§impl TakeFn for SparseArray
impl TakeFn for SparseArray
Source§impl TryFrom<&Array> for SparseArray
impl TryFrom<&Array> for SparseArray
Source§impl TryFrom<Array> for SparseArray
impl TryFrom<Array> for SparseArray
impl BinaryArrayTrait for SparseArray
impl ListArrayTrait for SparseArray
impl NullArrayTrait for SparseArray
impl Utf8ArrayTrait for SparseArray
Auto Trait Implementations§
impl !Freeze for SparseArray
impl !RefUnwindSafe for SparseArray
impl Send for SparseArray
impl Sync for SparseArray
impl Unpin for SparseArray
impl !UnwindSafe for SparseArray
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