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
impl RowAddrMask
pub fn all_rows() -> Self
pub fn allow_nothing() -> Self
pub fn from_allowed(allow_list: RowAddrTreeMap) -> Self
pub fn from_block(block_list: RowAddrTreeMap) -> Self
pub fn block_list(&self) -> Option<&RowAddrTreeMap>
pub fn allow_list(&self) -> Option<&RowAddrTreeMap>
Sourcepub fn selected(&self, row_id: u64) -> bool
pub fn selected(&self, row_id: u64) -> bool
True if the row_id is selected by the mask, false otherwise
Sourcepub fn selected_indices<'a>(
&self,
row_ids: impl Iterator<Item = &'a u64> + 'a,
) -> Vec<u64>
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
Sourcepub fn also_block(self, block_list: RowAddrTreeMap) -> Self
pub fn also_block(self, block_list: RowAddrTreeMap) -> Self
Also block the given addrs
Sourcepub fn also_allow(self, allow_list: RowAddrTreeMap) -> Self
pub fn also_allow(self, allow_list: RowAddrTreeMap) -> Self
Also allow the given addrs
Sourcepub fn into_arrow(&self) -> Result<BinaryArray>
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.
Sourcepub fn from_arrow(array: &GenericBinaryArray<i32>) -> Result<Self>
pub fn from_arrow(array: &GenericBinaryArray<i32>) -> Result<Self>
Deserialize a row address mask from Arrow
Sourcepub fn max_len(&self) -> Option<u64>
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)
Sourcepub fn iter_addrs(&self) -> Option<Box<dyn Iterator<Item = RowAddress> + '_>>
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
impl BitAnd for RowAddrMask
Source§impl BitOr for RowAddrMask
impl BitOr for RowAddrMask
Source§impl Clone for RowAddrMask
impl Clone for RowAddrMask
Source§fn clone(&self) -> RowAddrMask
fn clone(&self) -> RowAddrMask
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RowAddrMask
impl Debug for RowAddrMask
Source§impl DeepSizeOf for RowAddrMask
impl DeepSizeOf for RowAddrMask
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Source§impl Default for RowAddrMask
impl Default for RowAddrMask
Source§impl Not for RowAddrMask
impl Not for RowAddrMask
Source§impl PartialEq for RowAddrMask
impl PartialEq for RowAddrMask
impl StructuralPartialEq for RowAddrMask
Auto Trait Implementations§
impl Freeze for RowAddrMask
impl RefUnwindSafe for RowAddrMask
impl Send for RowAddrMask
impl Sync for RowAddrMask
impl Unpin for RowAddrMask
impl UnwindSafe for RowAddrMask
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> 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 more