pub struct Sparse;Implementations§
Source§impl Sparse
impl Sparse
Sourcepub fn try_new(
indices: ArrayRef,
values: ArrayRef,
len: usize,
fill_value: Scalar,
) -> VortexResult<SparseArray>
pub fn try_new( indices: ArrayRef, values: ArrayRef, len: usize, fill_value: Scalar, ) -> VortexResult<SparseArray>
Construct a new SparseArray from indices, values, length, and fill value.
pub fn try_new_from_patches( patches: Patches, fill_value: Scalar, ) -> VortexResult<SparseArray>
Sourcepub fn encode(
array: &ArrayRef,
fill_value: Option<Scalar>,
ctx: &mut ExecutionCtx,
) -> VortexResult<ArrayRef>
pub fn encode( array: &ArrayRef, fill_value: Option<Scalar>, ctx: &mut ExecutionCtx, ) -> VortexResult<ArrayRef>
Encode the given array as a SparseArray.
Trait Implementations§
Source§impl BetweenKernel for Sparse
Sparse-specific between kernel.
impl BetweenKernel for Sparse
Sparse-specific between kernel.
lower <= x <= upper (with per-bound strictness) over a Sparse column with constant
bounds is itself sparse: every unpatched position resolves to between(F, lo, hi) and
every patched position to between(patch, lo, hi). We push the range check into the
patches and rebuild a Sparse<Bool> with the new fill, preserving downstream sparsity.
Declines (falls back to canonical) unless both bounds are constants.
fn between( array: ArrayView<'_, Self>, lower: &ArrayRef, upper: &ArrayRef, options: &BetweenOptions, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>
Source§impl CastReduce for Sparse
impl CastReduce for Sparse
Source§impl CompareKernel for Sparse
Sparse-specific compare kernel.
impl CompareKernel for Sparse
Sparse-specific compare kernel.
When the RHS is a constant scalar, the result of any comparison is itself sparse:
every unpatched position resolves to compare(fill, rhs), and every patched position
to compare(patch, rhs). We push the comparison into the patches and rebuild a
Sparse<Bool> with the new fill, preserving downstream sparsity (filter masks, etc.).
For non-constant RHS we decline and let the canonical fallback handle it.
fn compare( lhs: ArrayView<'_, Self>, rhs: &ArrayRef, operator: CompareOperator, _ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>
Source§impl FillNullKernel for Sparse
Sparse-specific fill_null kernel.
impl FillNullKernel for Sparse
Sparse-specific fill_null kernel.
fill_null(Sparse{ F, patches }, v) replaces nulls in the fill and in each patch value
with the (non-null) v, staying sparse: the new fill is v if F was null, else F
cast to the non-nullable result dtype. The work is O(P).
fn fill_null( array: ArrayView<'_, Self>, fill_value: &Scalar, _ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>
Source§impl FilterKernel for Sparse
impl FilterKernel for Sparse
Source§fn filter(
array: ArrayView<'_, Self>,
mask: &Mask,
ctx: &mut ExecutionCtx,
) -> VortexResult<Option<ArrayRef>>
fn filter( array: ArrayView<'_, Self>, mask: &Mask, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>
Source§impl OperationsVTable<Sparse> for Sparse
impl OperationsVTable<Sparse> for Sparse
Source§fn scalar_at(
array: ArrayView<'_, Sparse>,
index: usize,
_ctx: &mut ExecutionCtx,
) -> VortexResult<Scalar>
fn scalar_at( array: ArrayView<'_, Sparse>, index: usize, _ctx: &mut ExecutionCtx, ) -> VortexResult<Scalar>
Source§impl SliceKernel for Sparse
impl SliceKernel for Sparse
Source§impl TakeExecute for Sparse
impl TakeExecute for Sparse
Source§fn take(
array: ArrayView<'_, Self>,
indices: &ArrayRef,
ctx: &mut ExecutionCtx,
) -> VortexResult<Option<ArrayRef>>
fn take( array: ArrayView<'_, Self>, indices: &ArrayRef, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>
Source§impl VTable for Sparse
impl VTable for Sparse
type TypedArrayData = SparseData
type OperationsVTable = Sparse
type ValidityVTable = Sparse
Source§fn validate(
&self,
data: &Self::TypedArrayData,
dtype: &DType,
len: usize,
slots: &[Option<ArrayRef>],
) -> VortexResult<()>
fn validate( &self, data: &Self::TypedArrayData, dtype: &DType, len: usize, slots: &[Option<ArrayRef>], ) -> VortexResult<()>
Source§fn buffer(array: ArrayView<'_, Self>, idx: usize) -> BufferHandle
fn buffer(array: ArrayView<'_, Self>, idx: usize) -> BufferHandle
Source§fn buffer_name(_array: ArrayView<'_, Self>, idx: usize) -> Option<String>
fn buffer_name(_array: ArrayView<'_, Self>, idx: usize) -> Option<String>
None if unnamed.Source§fn serialize(
array: ArrayView<'_, Self>,
_session: &VortexSession,
) -> VortexResult<Option<Vec<u8>>>
fn serialize( array: ArrayView<'_, Self>, _session: &VortexSession, ) -> VortexResult<Option<Vec<u8>>>
None if the array cannot be serialized.Source§fn deserialize(
&self,
dtype: &DType,
len: usize,
metadata: &[u8],
buffers: &[BufferHandle],
children: &dyn ArrayChildren,
session: &VortexSession,
) -> VortexResult<ArrayParts<Self>>
fn deserialize( &self, dtype: &DType, len: usize, metadata: &[u8], buffers: &[BufferHandle], children: &dyn ArrayChildren, session: &VortexSession, ) -> VortexResult<ArrayParts<Self>>
Source§fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String
fn slot_name(_array: ArrayView<'_, Self>, idx: usize) -> String
Source§fn reduce_parent(
array: ArrayView<'_, Self>,
parent: &ArrayRef,
child_idx: usize,
) -> VortexResult<Option<ArrayRef>>
fn reduce_parent( array: ArrayView<'_, Self>, parent: &ArrayRef, child_idx: usize, ) -> VortexResult<Option<ArrayRef>>
Source§fn execute_parent(
array: ArrayView<'_, Self>,
parent: &ArrayRef,
child_idx: usize,
ctx: &mut ExecutionCtx,
) -> VortexResult<Option<ArrayRef>>
fn execute_parent( array: ArrayView<'_, Self>, parent: &ArrayRef, child_idx: usize, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>
Source§fn execute(
array: Array<Self>,
ctx: &mut ExecutionCtx,
) -> VortexResult<ExecutionResult>
fn execute( array: Array<Self>, ctx: &mut ExecutionCtx, ) -> VortexResult<ExecutionResult>
ExecutionResult. Read moreSource§fn nchildren(array: ArrayView<'_, Self>) -> usize
fn nchildren(array: ArrayView<'_, Self>) -> usize
Source§fn child(array: ArrayView<'_, Self>, idx: usize) -> ArrayRef
fn child(array: ArrayView<'_, Self>, idx: usize) -> ArrayRef
Source§fn child_name(array: ArrayView<'_, Self>, idx: usize) -> String
fn child_name(array: ArrayView<'_, Self>, idx: usize) -> String
Source§fn append_to_builder(
array: ArrayView<'_, Self>,
builder: &mut dyn ArrayBuilder,
ctx: &mut ExecutionCtx,
) -> Result<(), VortexError>
fn append_to_builder( array: ArrayView<'_, Self>, builder: &mut dyn ArrayBuilder, ctx: &mut ExecutionCtx, ) -> Result<(), VortexError>
Auto Trait Implementations§
impl Freeze for Sparse
impl RefUnwindSafe for Sparse
impl Send for Sparse
impl Sync for Sparse
impl Unpin for Sparse
impl UnsafeUnpin for Sparse
impl UnwindSafe for Sparse
Blanket Implementations§
Source§impl<V> ArrayPlugin for Vwhere
V: VTable,
impl<V> ArrayPlugin for Vwhere
V: VTable,
Source§fn serialize(
&self,
array: &ArrayRef,
session: &VortexSession,
) -> Result<Option<Vec<u8>>, VortexError>
fn serialize( &self, array: &ArrayRef, session: &VortexSession, ) -> Result<Option<Vec<u8>>, VortexError>
Source§fn deserialize(
&self,
dtype: &DType,
len: usize,
metadata: &[u8],
buffers: &[BufferHandle],
children: &dyn ArrayChildren,
session: &VortexSession,
) -> Result<ArrayRef, VortexError>
fn deserialize( &self, dtype: &DType, len: usize, metadata: &[u8], buffers: &[BufferHandle], children: &dyn ArrayChildren, session: &VortexSession, ) -> Result<ArrayRef, VortexError>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.