Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deletion_vector method and handle Result from reading deletion file properly #965

Merged
merged 1 commit into from
Jun 12, 2023
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
11 changes: 0 additions & 11 deletions rust/src/format/fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ use std::collections::BTreeSet;

use crate::datatypes::Schema;
use crate::format::pb;
use crate::io::deletion::{read_deletion_file, DeletionVector};
use crate::io::ObjectStore;

/// Lance Data File
///
Expand Down Expand Up @@ -134,15 +132,6 @@ impl Fragment {
.into_iter()
.collect()
}

pub(crate) async fn deletion_vector(
&self,
object_store: &ObjectStore,
) -> Option<DeletionVector> {
read_deletion_file(&object_store.base_path(), self, object_store)
.await
.unwrap()
}
}

impl From<&pb::DataFragment> for Fragment {
Expand Down
8 changes: 4 additions & 4 deletions rust/src/io/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use futures::StreamExt;
use object_store::path::Path;
use prost::Message;

use super::deletion::DeletionVector;
use super::deletion::{read_deletion_file, DeletionVector};
use super::ReadBatchParams;
use crate::arrow::*;
use crate::encodings::{dictionary::DictionaryDecoder, AsyncIndex};
Expand Down Expand Up @@ -217,11 +217,11 @@ impl FileReader {
.map(|f| f.to_owned());

let deletion_vector = match &fragment {
Some(frag) => frag.deletion_vector(object_store).await,
None => None,
Some(frag) => read_deletion_file(object_store.base_path(), frag, object_store).await,
None => Ok(None),
};

Ok(Self {
deletion_vector.map(|deletion_vector| Self {
object_reader: object_reader.into(),
metadata,
projection: Some(projection),
Expand Down