Skip to content
Merged
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
7 changes: 4 additions & 3 deletions rust/lance/src/dataset/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,10 @@ impl LanceFilter {
})
}
#[cfg(not(feature = "substrait"))]
Self::Substrait(_) => {
panic!("Substrait filter is not supported in this build");
}
Self::Substrait(_) => Err(Error::NotSupported {
source: "Substrait filter is not supported in this build".into(),
location: location!(),
}),
Self::Datafusion(expr) => Ok(expr.clone()),
}
}
Expand Down
4 changes: 2 additions & 2 deletions rust/lance/src/index/vector/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,10 @@ impl<S: IvfSubIndex + 'static, Q: Quantization + 'static> IvfIndexBuilder<S, Q>
.peekable(),
);

let batch = transformed_stream.as_mut().peek().await;
let batch = transformed_stream.as_mut().peek_mut().await;
let schema = match batch {
Some(Ok(b)) => b.schema(),
Some(Err(e)) => panic!("do this better: error reading first batch: {:?}", e),
Some(Err(e)) => return Err(std::mem::replace(e, Error::Stop)),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this swallow the underlying error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it returns the underlying error. Since we are peeking into the stream, we only have an &mut Error not an owned Error. So we just use std::mem::replace to get the owned Error and replace the one in the stream with a dummy Error::Stop.

None => {
log::info!("no data to shuffle");
self.shuffle_reader = Some(Arc::new(IvfShufflerReader::new(
Expand Down