Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions java/lance-jni/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions rust/lance-index/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,24 @@ impl OldIndexDataFilter {
.collect(),
}
}

/// Filter a posting list of row addresses in place, retaining only the rows
/// selected by this filter.
pub fn retain_row_addrs(&self, addrs: &mut RowAddrTreeMap) {
match self {
Self::Fragments { to_keep, .. } => addrs.retain_fragments_in(to_keep),
Self::RowIds(valid_row_ids) => *addrs &= valid_row_ids,
}
}

/// True if this filter would keep no rows at all (its keep-set is empty),
/// letting a segment merge skip reading the source segment entirely.
pub fn keeps_nothing(&self) -> bool {
match self {
Self::Fragments { to_keep, .. } => to_keep.is_empty(),
Self::RowIds(valid_row_ids) => valid_row_ids.is_empty(),
}
}
}

impl UpdateCriteria {
Expand Down
Loading
Loading