Skip to content

Commit

Permalink
feat: stable row id support in queries (#2452)
Browse files Browse the repository at this point in the history
Part of #2307

* Turns on unit tests to validate we can use ANN and scalar indices with
move-stable row ids.
* Changed pre-filter to support move-stable row ids
* Major change is that the deletion mask is no longer always a block
list. With address-style rod ids they are, but now with stable row ids
they will instead be an allow list.
  • Loading branch information
wjones127 authored Jun 26, 2024
1 parent 6f752c4 commit 63227f4
Show file tree
Hide file tree
Showing 17 changed files with 920 additions and 171 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@ Cargo.lock

python/venv
test_data/venv

**/*.profraw
16 changes: 16 additions & 0 deletions rust/lance-arrow/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pub trait SchemaExt {
) -> std::result::Result<Schema, ArrowError>;

fn field_names(&self) -> Vec<&String>;

fn without_column(&self, column_name: &str) -> Schema;
}

impl SchemaExt for Schema {
Expand Down Expand Up @@ -50,6 +52,20 @@ impl SchemaExt for Schema {
Ok(Self::new_with_metadata(fields, self.metadata.clone()))
}

/// Project the schema to remove the given column.
///
/// This only works on top-level fields right now. If a field does not exist,
/// the schema will be returned as is.
fn without_column(&self, column_name: &str) -> Schema {
let fields: Vec<FieldRef> = self
.fields()
.iter()
.filter(|f| f.name() != column_name)
.cloned()
.collect();
Self::new_with_metadata(fields, self.metadata.clone())
}

fn field_names(&self) -> Vec<&String> {
self.fields().iter().map(|f| f.name()).collect()
}
Expand Down
Loading

0 comments on commit 63227f4

Please # to comment.