Struct lance_table::format::Fragment
source · pub struct Fragment {
pub id: u64,
pub files: Vec<DataFile>,
pub deletion_file: Option<DeletionFile>,
pub row_id_meta: Option<RowIdMeta>,
pub physical_rows: Option<usize>,
}Expand description
Data fragment.
A fragment is a set of files which represent the different columns of the same rows.
If column exists in the schema, but the related file does not exist, treat this column as nulls.
Fields§
§id: u64Fragment ID
files: Vec<DataFile>Files within the fragment.
deletion_file: Option<DeletionFile>Optional file with deleted row ids.
row_id_meta: Option<RowIdMeta>RowIndex
physical_rows: Option<usize>Original number of rows in the fragment. If this is None, then it is unknown. This is only optional for legacy reasons. All new tables should have this set.
Implementations§
source§impl Fragment
impl Fragment
pub fn new(id: u64) -> Self
pub fn num_rows(&self) -> Option<usize>
pub fn from_json(json: &str) -> Result<Self>
sourcepub fn with_file_legacy(
id: u64,
path: &str,
schema: &Schema,
physical_rows: Option<usize>,
) -> Self
pub fn with_file_legacy( id: u64, path: &str, schema: &Schema, physical_rows: Option<usize>, ) -> Self
Create a Fragment with one DataFile
pub fn add_file( &mut self, path: impl Into<String>, field_ids: Vec<i32>, column_indices: Vec<i32>, )
sourcepub fn add_file_legacy(&mut self, path: &str, schema: &Schema)
pub fn add_file_legacy(&mut self, path: &str, schema: &Schema)
Add a new DataFile to this fragment.
pub fn has_legacy_files(&self) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Fragment
impl<'de> Deserialize<'de> for Fragment
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<&Fragment> for DataFragment
impl From<&Fragment> for DataFragment
source§impl PartialEq for Fragment
impl PartialEq for Fragment
source§impl TryFrom<DataFragment> for Fragment
impl TryFrom<DataFragment> for Fragment
impl Eq for Fragment
impl StructuralPartialEq for Fragment
Auto Trait Implementations§
impl Freeze for Fragment
impl RefUnwindSafe for Fragment
impl Send for Fragment
impl Sync for Fragment
impl Unpin for Fragment
impl UnwindSafe for Fragment
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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