pub struct SparseArray(/* private fields */);
Implementations§
Source§impl SparseArray
impl SparseArray
pub fn try_new( indices: ArrayData, values: ArrayData, len: usize, fill_value: Scalar, ) -> VortexResult<Self>
pub fn indices_offset(&self) -> usize
pub fn values(&self) -> ArrayData
pub fn indices(&self) -> ArrayData
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 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<ArrayData> for SparseArray
impl AsRef<ArrayData> for SparseArray
Source§impl BoolArrayTrait for SparseArray
impl BoolArrayTrait for SparseArray
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<SparseArray> for SparseEncoding
impl FilterFn<SparseArray> for SparseEncoding
Source§fn filter(
&self,
array: &SparseArray,
mask: FilterMask,
) -> VortexResult<ArrayData>
fn filter( &self, array: &SparseArray, mask: FilterMask, ) -> VortexResult<ArrayData>
Filter an array by the provided predicate.
Source§impl IntoArrayData for SparseArray
impl IntoArrayData for SparseArray
fn into_array(self) -> ArrayData
Source§impl IntoCanonical for SparseArray
impl IntoCanonical for SparseArray
fn into_canonical(self) -> VortexResult<Canonical>
Source§impl PrimitiveArrayTrait for SparseArray
impl PrimitiveArrayTrait for SparseArray
Source§impl ScalarAtFn<SparseArray> for SparseEncoding
impl ScalarAtFn<SparseArray> for SparseEncoding
fn scalar_at(&self, array: &SparseArray, index: usize) -> VortexResult<Scalar>
Source§impl SearchSortedFn<SparseArray> for SparseEncoding
impl SearchSortedFn<SparseArray> for SparseEncoding
fn search_sorted( &self, array: &SparseArray, value: &Scalar, side: SearchSortedSide, ) -> VortexResult<SearchResult>
fn search_sorted_usize( &self, array: &Array, value: usize, side: SearchSortedSide, ) -> VortexResult<SearchResult>
Source§fn search_sorted_many(
&self,
array: &Array,
values: &[Scalar],
side: SearchSortedSide,
) -> VortexResult<Vec<SearchResult>>
fn search_sorted_many( &self, array: &Array, values: &[Scalar], side: SearchSortedSide, ) -> VortexResult<Vec<SearchResult>>
Bulk search for many values.
fn search_sorted_usize_many( &self, array: &Array, values: &[usize], side: SearchSortedSide, ) -> VortexResult<Vec<SearchResult>>
Source§impl SliceFn<SparseArray> for SparseEncoding
impl SliceFn<SparseArray> for SparseEncoding
Source§fn slice(
&self,
array: &SparseArray,
start: usize,
stop: usize,
) -> VortexResult<ArrayData>
fn slice( &self, array: &SparseArray, start: usize, stop: usize, ) -> VortexResult<ArrayData>
Return a zero-copy slice of an array, between
start
(inclusive) and end
(exclusive).
If start >= stop, returns an empty array of the same type as self
.
Assumes that start or stop are out of bounds, may panic otherwise.Source§impl StatisticsVTable<SparseArray> for SparseEncoding
impl StatisticsVTable<SparseArray> for SparseEncoding
Source§fn compute_statistics(
&self,
array: &SparseArray,
stat: Stat,
) -> VortexResult<StatsSet>
fn compute_statistics( &self, array: &SparseArray, stat: Stat, ) -> VortexResult<StatsSet>
Compute the requested statistic. Can return additional stats.
Source§impl StructArrayTrait for SparseArray
impl StructArrayTrait for SparseArray
Source§impl TakeFn<SparseArray> for SparseEncoding
impl TakeFn<SparseArray> for SparseEncoding
fn take( &self, array: &SparseArray, indices: &ArrayData, options: TakeOptions, ) -> VortexResult<ArrayData>
Source§impl<'a> TryFrom<&'a ArrayData> for &'a SparseArray
impl<'a> TryFrom<&'a ArrayData> for &'a SparseArray
Source§type Error = VortexError
type Error = VortexError
The type returned in the event of a conversion error.
Source§fn try_from(data: &'a ArrayData) -> VortexResult<Self>
fn try_from(data: &'a ArrayData) -> VortexResult<Self>
Performs the conversion.
Source§impl TryFrom<ArrayData> for SparseArray
impl TryFrom<ArrayData> for SparseArray
Source§type Error = VortexError
type Error = VortexError
The type returned in the event of a conversion error.
Source§fn try_from(data: ArrayData) -> VortexResult<Self>
fn try_from(data: ArrayData) -> VortexResult<Self>
Performs the conversion.
Source§impl ValidityVTable<SparseArray> for SparseEncoding
impl ValidityVTable<SparseArray> for SparseEncoding
fn is_valid(&self, array: &SparseArray, index: usize) -> bool
fn logical_validity(&self, array: &SparseArray) -> LogicalValidity
Source§impl VisitorVTable<SparseArray> for SparseEncoding
impl VisitorVTable<SparseArray> for SparseEncoding
fn accept( &self, array: &SparseArray, visitor: &mut dyn ArrayVisitor, ) -> VortexResult<()>
impl ArrayTrait 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 EncodingVTable
Source§impl<A> ArrayNBytes for A
impl<A> ArrayNBytes for A
Source§impl<T> ArrayStatistics for T
impl<T> ArrayStatistics for T
fn statistics(&self) -> &dyn Statistics
fn inherit_statistics(&self, parent: &dyn Statistics)
Source§impl<A> ArrayValidity for A
impl<A> ArrayValidity for A
fn is_valid(&self, index: usize) -> bool
fn logical_validity(&self) -> LogicalValidity
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