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: u64
Fragment ID
files: Vec<DataFile>
Files within the fragment.
deletion_file: Option<DeletionFile>
Optional file with deleted local row offsets.
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>, version: &LanceFileVersion, )
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
pub fn try_infer_version(fragments: &[Self]) -> Result<Option<LanceFileVersion>>
Trait Implementations§
Source§impl DeepSizeOf for Fragment
impl DeepSizeOf for Fragment
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Returns an estimation of the heap-managed storage of this object.
This does not include the size of the object itself. Read more
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Returns an estimation of a total size of memory owned by the
object, including heap-managed storage. Read more
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 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreCreates a shared type from an unshared type.