pub enum Validity {
NonNullable,
AllValid,
AllInvalid,
Array(ArrayRef),
}
Expand description
Validity information for an array
Variants§
NonNullable
Items can’t be null
AllValid
All items are valid
AllInvalid
All items are null
Array(ArrayRef)
Specified items are null
Implementations§
Source§impl Validity
impl Validity
pub fn null_count(&self, length: usize) -> VortexResult<usize>
Sourcepub fn into_array(self) -> Option<ArrayRef>
pub fn into_array(self) -> Option<ArrayRef>
If Validity is Validity::Array
, returns the array, otherwise returns None
.
Sourcepub fn as_array(&self) -> Option<&ArrayRef>
pub fn as_array(&self) -> Option<&ArrayRef>
If Validity is Validity::Array
, returns a reference to the array array, otherwise returns None
.
pub fn nullability(&self) -> Nullability
Sourcepub fn union_nullability(self, nullability: Nullability) -> Self
pub fn union_nullability(self, nullability: Nullability) -> Self
The union nullability and validity.
pub fn all_valid(&self) -> VortexResult<bool>
pub fn all_invalid(&self) -> VortexResult<bool>
Sourcepub fn is_valid(&self, index: usize) -> VortexResult<bool>
pub fn is_valid(&self, index: usize) -> VortexResult<bool>
Returns whether the index
item is valid.
pub fn is_null(&self, index: usize) -> VortexResult<bool>
pub fn slice(&self, start: usize, stop: usize) -> VortexResult<Self>
pub fn take(&self, indices: &dyn Array) -> VortexResult<Self>
Sourcepub fn filter(&self, mask: &Mask) -> VortexResult<Self>
pub fn filter(&self, mask: &Mask) -> VortexResult<Self>
Keep only the entries for which the mask is true.
The result has length equal to the number of true values in mask.
Sourcepub fn mask(&self, mask: &Mask) -> VortexResult<Self>
pub fn mask(&self, mask: &Mask) -> VortexResult<Self>
Set to false any entries for which the mask is true.
The result is always nullable. The result has the same length as self.
pub fn to_mask(&self, length: usize) -> VortexResult<Mask>
Sourcepub fn and(self, rhs: Validity) -> VortexResult<Validity>
pub fn and(self, rhs: Validity) -> VortexResult<Validity>
Logically & two Validity values of the same length
pub fn patch( self, len: usize, indices_offset: usize, indices: &dyn Array, patches: &Validity, ) -> VortexResult<Self>
Sourcepub fn into_nullable(self) -> Validity
pub fn into_nullable(self) -> Validity
Convert into a nullable variant
Sourcepub fn into_non_nullable(self) -> Option<Validity>
pub fn into_non_nullable(self) -> Option<Validity>
Convert into a non-nullable variant
Sourcepub fn cast_nullability(
self,
nullability: Nullability,
) -> VortexResult<Validity>
pub fn cast_nullability( self, nullability: Nullability, ) -> VortexResult<Validity>
Convert into a variant compatible with the given nullability, if possible.
Sourcepub fn copy_from_array(array: &dyn Array) -> VortexResult<Self>
pub fn copy_from_array(array: &dyn Array) -> VortexResult<Self>
Create Validity by copying the given array’s validity.
Sourcepub fn maybe_len(&self) -> Option<usize>
pub fn maybe_len(&self) -> Option<usize>
Returns the length of the validity array, if it exists.
pub fn uncompressed_size(&self) -> usize
pub fn is_array(&self) -> bool
Trait Implementations§
Source§impl From<BooleanBuffer> for Validity
impl From<BooleanBuffer> for Validity
Source§fn from(value: BooleanBuffer) -> Self
fn from(value: BooleanBuffer) -> Self
Source§impl From<NullBuffer> for Validity
impl From<NullBuffer> for Validity
Source§fn from(value: NullBuffer) -> Self
fn from(value: NullBuffer) -> Self
Source§impl From<Nullability> for Validity
impl From<Nullability> for Validity
Source§fn from(value: Nullability) -> Self
fn from(value: Nullability) -> Self
Source§impl FromIterator<Mask> for Validity
impl FromIterator<Mask> for Validity
Source§impl FromIterator<bool> for Validity
impl FromIterator<bool> for Validity
Auto Trait Implementations§
impl Freeze for Validity
impl !RefUnwindSafe for Validity
impl Send for Validity
impl Sync for Validity
impl Unpin for Validity
impl !UnwindSafe for Validity
Blanket Implementations§
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> 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 more