pub struct DeleteVector { /* private fields */ }Expand description
The deleted row positions of one data file: a set of 64-bit positions,
kept as a [RoaringTreemap].
Implementations§
Source§impl DeleteVector
impl DeleteVector
Sourcepub fn new(roaring_treemap: RoaringTreemap) -> DeleteVector
pub fn new(roaring_treemap: RoaringTreemap) -> DeleteVector
Wraps roaring_treemap, whose members are the deleted positions.
Sourcepub fn iter(&self) -> DeleteVectorIterator<'_> ⓘ
pub fn iter(&self) -> DeleteVectorIterator<'_> ⓘ
Iterates the deleted positions in ascending order.
Sourcepub fn insert(&mut self, pos: u64) -> bool
pub fn insert(&mut self, pos: u64) -> bool
Marks pos as deleted, returning whether it was not already.
Sourcepub fn insert_positions(&mut self, positions: &[u64]) -> Result<usize>
pub fn insert_positions(&mut self, positions: &[u64]) -> Result<usize>
Marks the given positions as deleted and returns the number of elements appended.
The input slice must be strictly ordered in ascending order, and every value must be greater than all existing values already in the set.
§Errors
Returns an error if the precondition is not met.
Sourcepub fn deserialize(blob: &[u8]) -> Result<Self>
pub fn deserialize(blob: &[u8]) -> Result<Self>
Parses a deletion-vector-v1 Puffin blob into a DeleteVector.
The layout, defined by the Iceberg Puffin spec and matching Iceberg-Java’s
BitmapPositionDeleteIndex, is:
[length: u32 big-endian][magic: D1 D3 39 64][vector][crc: u32 big-endian]length counts the magic and vector bytes (not itself or the CRC). The CRC-32 is
computed over the magic and vector. vector is a roaring bitmap in the portable 64-bit
format: a directory of 32-bit key / 32-bit roaring bitmap pairs, ordered by unsigned
comparison of the keys, one bitmap per key.
§Errors
Returns ErrorKind::DataInvalid if the blob is shorter than the minimum, the length
prefix or CRC does not match, the magic is wrong, the roaring bitmap count exceeds the
portable format’s maximum, the roaring directory’s keys are not ordered by unsigned
comparison, or the roaring payload fails to decode.
Trait Implementations§
Source§impl BitOrAssign for DeleteVector
impl BitOrAssign for DeleteVector
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
|= operation. Read moreSource§impl Debug for DeleteVector
impl Debug for DeleteVector
Source§impl Default for DeleteVector
impl Default for DeleteVector
Source§fn default() -> DeleteVector
fn default() -> DeleteVector
Auto Trait Implementations§
impl Freeze for DeleteVector
impl RefUnwindSafe for DeleteVector
impl Send for DeleteVector
impl Sync for DeleteVector
impl Unpin for DeleteVector
impl UnsafeUnpin for DeleteVector
impl UnwindSafe for DeleteVector
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Any.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Any.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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