pub struct IndexMetadata {
pub uuid: Option<Uuid>,
pub fields: Vec<i32>,
pub name: String,
pub dataset_version: u64,
pub fragment_bitmap: Vec<u8>,
pub index_details: Option<Any>,
pub index_version: Option<i32>,
pub created_at: Option<u64>,
pub base_id: Option<u32>,
pub files: Vec<IndexFile>,
pub covering_fields: Vec<i32>,
}Expand description
Metadata describing an index.
Fields§
§uuid: Option<Uuid>Unique ID of an index. It is unique across all the dataset versions.
fields: Vec<i32>The columns to build the index. These refer to file.Field.id.
fields[0] is always a column the index is keyed on. Trailing entries may
instead be merely carried, not keyed on – see covering_fields below.
name: StringIndex name. Must be unique within one dataset version.
dataset_version: u64The version of the dataset this index was built from.
fragment_bitmap: Vec<u8>A bitmap of the included fragment ids.
This may by used to determine how much of the dataset is covered by the
index. This information can be retrieved from the dataset by looking at
the dataset at dataset_version. However, since the old version may be
deleted while the index is still in use, this information is also stored
in the index.
The bitmap is stored as a 32-bit Roaring bitmap.
index_details: Option<Any>Details, specific to the index type, which are needed to load / interpret the index
Indices should avoid putting large amounts of information in this field, as it will bloat the manifest.
Indexes are plugins, and so the format of the details message is flexible and not fully defined by the table format. However, there are some conventions that should be followed:
- When Lance APIs refer to indexes they will use the type URL of the index details as the identifier for the index type. If a user provides a simple string identifier like “btree” then it will be converted to “/lance.table.BTreeIndexDetails”
- Type URLs comparisons are case-insensitive. Thereform an index must have a unique type URL ignoring case.
index_version: Option<i32>The minimum lance version that this index is compatible with.
created_at: Option<u64>Timestamp when the index was created (UTC timestamp in milliseconds since epoch)
This field is optional for backward compatibility. For existing indices created before this field was added, this will be None/null.
base_id: Option<u32>The base path index of the data file. Used when the file is imported or referred from another dataset. Lance use it as key of the base_paths field in Manifest to determine the actual base path of the data file.
files: Vec<IndexFile>List of files and their sizes for this index segment. This enables skipping HEAD calls when opening indices and allows reporting of index sizes without extra IO. If this is empty, the index files sizes are unknown.
covering_fields: Vec<i32>The subset of fields whose values this index co-locates alongside its own
data, so a query projecting only those columns can be answered from the
index without a take against the base table.
Must be a suffix of fields: the columns the index is keyed on come first,
the columns it merely carries come last, and at least one keyed column
always remains. Empty for an index that carries no extra columns, which is
every index written before this field existed.
Carried columns are listed in fields as well. That is deliberate: every
consumer that reads fields as the index’s dependency set – staleness,
commit conflict detection, schema evolution guards – then covers them with
no change and no way to forget one.
This declaration is not authoritative for what the segment can actually serve. The segment’s own storage schema is: a reader must confirm the storage carries a column before answering a query from it, and fall back to a take against the base table otherwise. A declaration naming columns the storage does not hold is a legal state, not corruption – a maintenance operation that cannot carry the values through a rebuild is permitted to withdraw the payload while leaving this declaration in place.
Implementations§
Source§impl IndexMetadata
impl IndexMetadata
Sourcepub fn index_version(&self) -> i32
pub fn index_version(&self) -> i32
Returns the value of index_version, or the default value if index_version is unset.
Sourcepub fn created_at(&self) -> u64
pub fn created_at(&self) -> u64
Returns the value of created_at, or the default value if created_at is unset.
Trait Implementations§
Source§impl Clone for IndexMetadata
impl Clone for IndexMetadata
Source§fn clone(&self) -> IndexMetadata
fn clone(&self) -> IndexMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IndexMetadata
impl Debug for IndexMetadata
Source§impl Default for IndexMetadata
impl Default for IndexMetadata
Source§impl Message for IndexMetadata
impl Message for IndexMetadata
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for IndexMetadata
impl PartialEq for IndexMetadata
impl StructuralPartialEq for IndexMetadata
Auto Trait Implementations§
impl Freeze for IndexMetadata
impl RefUnwindSafe for IndexMetadata
impl Send for IndexMetadata
impl Sync for IndexMetadata
impl Unpin for IndexMetadata
impl UnsafeUnpin for IndexMetadata
impl UnwindSafe for IndexMetadata
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.