pub struct EqualityDeleteFilter { /* private fields */ }Expand description
In-memory equality delete filter built from one or more delete files.
Each entry is one source delete file’s own sequence number plus its
column_name → set of string-normalised values to delete. A data row is
deleted by a given entry if, for every column in that entry’s predicate,
the row’s value is a member of that column’s set (AND, not OR) — and
the entry’s sequence number is strictly greater than the data file’s own
(Iceberg spec: a delete only applies to files committed strictly before
it). Kept as a Vec of per-file predicates rather than one merged map —
unlike a plain column→values union, the per-file sequence number can’t be
collapsed away: two delete files touching the same column need their
masks evaluated against different data-file sequence numbers.
Implementations§
Source§impl EqualityDeleteFilter
impl EqualityDeleteFilter
Sourcepub async fn from_files(
store: &Arc<dyn Store>,
files: &[EqualityDeleteFile],
) -> AilakeResult<Self>
pub async fn from_files( store: &Arc<dyn Store>, files: &[EqualityDeleteFile], ) -> AilakeResult<Self>
Build filter from a list of equality delete file references.
For each file, downloads the Avro payload from store, extracts
(column_name, value) pairs, and keeps the file’s own
EqualityDeleteFile::sequence_number alongside — needed later so
should_delete_row/apply can skip predicates that don’t apply to
the data file currently being scanned.
pub fn empty() -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn should_delete_row(
&self,
batch: &RecordBatch,
row_idx: usize,
data_file_sequence_number: i64,
) -> bool
pub fn should_delete_row( &self, batch: &RecordBatch, row_idx: usize, data_file_sequence_number: i64, ) -> bool
Check whether a single row (by its physical index in batch) matches any
applicable delete predicate.
Returns true if the row should be logically deleted. data_file_sequence_number
is the sequence number of the data file batch was read from
(DataFileEntry::sequence_number) — a delete predicate only applies when its own
sequence number is strictly greater than this, per Iceberg spec. This is what lets
an insert and a delete of the same key committed in the same snapshot (equal
sequence numbers) leave the insert visible, instead of the delete masking the row
it was committed alongside.
Sourcepub fn apply(
&self,
batch: RecordBatch,
data_file_sequence_number: i64,
) -> AilakeResult<RecordBatch>
pub fn apply( &self, batch: RecordBatch, data_file_sequence_number: i64, ) -> AilakeResult<RecordBatch>
Apply the filter to batch, returning a new batch with matching rows removed.
data_file_sequence_number — see should_delete_row doc.
Auto Trait Implementations§
impl Freeze for EqualityDeleteFilter
impl RefUnwindSafe for EqualityDeleteFilter
impl Send for EqualityDeleteFilter
impl Sync for EqualityDeleteFilter
impl Unpin for EqualityDeleteFilter
impl UnsafeUnpin for EqualityDeleteFilter
impl UnwindSafe for EqualityDeleteFilter
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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