Skip to main content

RowAddrMask

Enum RowAddrMask 

Source
pub enum RowAddrMask {
    AllowList(RowAddrTreeMap),
    BlockList(RowAddrTreeMap),
}
Expand description

A mask that selects or deselects rows based on an allow-list or block-list.

Variants§

§

AllowList(RowAddrTreeMap)

§

BlockList(RowAddrTreeMap)

Implementations§

Source§

impl RowAddrMask

Source

pub fn all_rows() -> Self

Source

pub fn allow_nothing() -> Self

Source

pub fn from_allowed(allow_list: RowAddrTreeMap) -> Self

Source

pub fn from_block(block_list: RowAddrTreeMap) -> Self

Source

pub fn block_list(&self) -> Option<&RowAddrTreeMap>

Source

pub fn allow_list(&self) -> Option<&RowAddrTreeMap>

Source

pub fn selected(&self, row_id: u64) -> bool

True if the row_id is selected by the mask, false otherwise

Source

pub fn selected_indices<'a>( &self, row_ids: impl Iterator<Item = &'a u64> + 'a, ) -> Vec<u64>

Return the indices of the input row ids that were valid

Source

pub fn also_block(self, block_list: RowAddrTreeMap) -> Self

Also block the given addrs

Source

pub fn also_allow(self, allow_list: RowAddrTreeMap) -> Self

Also allow the given addrs

Source

pub fn into_arrow(&self) -> Result<BinaryArray>

Convert a mask into an arrow array

A row addr mask is not very arrow-compatible. We can’t make it a batch with two columns because the block list and allow list will have different lengths. Also, there is no Arrow type for compressed bitmaps.

However, we need to shove it into some kind of Arrow container to pass it along the datafusion stream. Perhaps, in the future, we can add row addr masks as first class types in datafusion, and this can be passed along as a mask / selection vector.

We serialize this as a variable length binary array with two items. The first item is the block list and the second item is the allow list.

Source

pub fn from_arrow(array: &GenericBinaryArray<i32>) -> Result<Self>

Deserialize a row address mask from Arrow

Source

pub fn max_len(&self) -> Option<u64>

Return the maximum number of row addresses that could be selected by this mask

Will be None if this is a BlockList (unbounded)

Source

pub fn iter_addrs(&self) -> Option<Box<dyn Iterator<Item = RowAddress> + '_>>

Iterate over the row addresses that are selected by the mask

This is only possible if this is an AllowList and the maps don’t contain any “full fragment” blocks.

Trait Implementations§

Source§

impl BitAnd for RowAddrMask

Source§

type Output = RowAddrMask

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self::Output

Performs the & operation. Read more
Source§

impl BitOr for RowAddrMask

Source§

type Output = RowAddrMask

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self::Output

Performs the | operation. Read more
Source§

impl Clone for RowAddrMask

Source§

fn clone(&self) -> RowAddrMask

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RowAddrMask

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DeepSizeOf for RowAddrMask

Source§

fn deep_size_of_children(&self, context: &mut Context) -> usize

Returns an estimation of the heap-managed storage of this object. This does not include the size of the object itself. Read more
Source§

fn deep_size_of(&self) -> usize

Returns an estimation of a total size of memory owned by the object, including heap-managed storage. Read more
Source§

impl Default for RowAddrMask

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Not for RowAddrMask

Source§

type Output = RowAddrMask

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq for RowAddrMask

Source§

fn eq(&self, other: &RowAddrMask) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for RowAddrMask

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,