pub struct AilakeFileReader { /* private fields */ }Implementations§
Source§impl AilakeFileReader
impl AilakeFileReader
pub fn new(bytes: Bytes, vector_column: &str, dim: u32) -> Self
Sourcepub fn ailk_offset(&self) -> AilakeResult<u64>
pub fn ailk_offset(&self) -> AilakeResult<u64>
Returns the absolute byte offset of the primary AILK section.
Tries ailake.footer_offset from Parquet KV metadata first (files written
by write() / write_multi()). Falls back to AilakeTrailer bootstrap for
files produced by write_single_pass() / write_multi_single_pass().
Sourcepub fn ailk_offset_for_column(&self, column: &str) -> AilakeResult<u64>
pub fn ailk_offset_for_column(&self, column: &str) -> AilakeResult<u64>
Returns the absolute byte offset of the AILK section for a named vector column.
Resolution order:
ailake.{column}.footer_offsetKV (extra columns in multi-column files)ailake.footer_offsetKV (primary column or single-column files)AilakeTrailerscan (streaming / single-pass files without KV injection)
True iff this file has its own AILK section specifically for column — i.e. a
ailake.{column}.footer_offset KV entry is present.
Unlike ailk_offset_for_column(), this does not fall back to the primary
column’s footer or the trailer bootstrap: those fallbacks make
ailk_offset_for_column(...).is_ok() return true for any AI-Lake file
regardless of column, which is correct for “give me an offset to read” but
wrong for “does this specific secondary column exist” — e.g. an idempotency
check before adding a new vector column to files that don’t have it yet.
Sourcepub fn is_ailake_file(&self) -> bool
pub fn is_ailake_file(&self) -> bool
Returns true if the file contains an embedded AILK section.
Sourcepub fn read_header(&self) -> AilakeResult<AilakeHeader>
pub fn read_header(&self) -> AilakeResult<AilakeHeader>
Parse the 64-byte AI-Lake header from the embedded AILK section.
Sourcepub fn read_header_for_column(&self, column: &str) -> AilakeResult<AilakeHeader>
pub fn read_header_for_column(&self, column: &str) -> AilakeResult<AilakeHeader>
Parse the 64-byte AI-Lake header for a named vector column.
Uses ailake.{column}.footer_offset for extra columns and falls back to
ailake.footer_offset for the primary column (single-column files).
Sourcepub fn get_centroid(&self) -> AilakeResult<Centroid>
pub fn get_centroid(&self) -> AilakeResult<Centroid>
Read centroid + radius from the AILK section.
Sourcepub fn load_index(&self) -> AilakeResult<HnswIndex>
pub fn load_index(&self) -> AilakeResult<HnswIndex>
Load the HNSW index from the primary AILK section.
Sourcepub fn load_index_for_column(&self, column: &str) -> AilakeResult<HnswIndex>
pub fn load_index_for_column(&self, column: &str) -> AilakeResult<HnswIndex>
Load the HNSW index for a specific vector column.
Works for both single-column files (falls back to primary AILK) and
multi-column files written with AilakeFileWriter::write_multi.
Sourcepub fn load_any_index(&self) -> AilakeResult<AnyIndex>
pub fn load_any_index(&self) -> AilakeResult<AnyIndex>
Load primary index as AnyIndex, dispatching on header flags.
Sourcepub fn load_any_index_for_column(&self, column: &str) -> AilakeResult<AnyIndex>
pub fn load_any_index_for_column(&self, column: &str) -> AilakeResult<AnyIndex>
Load index for a specific vector column as AnyIndex.
Sourcepub fn read_parquet(&self) -> AilakeResult<(RecordBatch, Vec<Vec<f32>>)>
pub fn read_parquet(&self) -> AilakeResult<(RecordBatch, Vec<Vec<f32>>)>
Read the Parquet section (tabular data + decoded embeddings). The full file is valid Parquet; the AILK section is invisible to standard readers.
Sourcepub fn read_parquet_filtered(
&self,
filter: &ColumnFilter,
) -> AilakeResult<(RecordBatch, Vec<Vec<f32>>)>
pub fn read_parquet_filtered( &self, filter: &ColumnFilter, ) -> AilakeResult<(RecordBatch, Vec<Vec<f32>>)>
Same as read_parquet, but pushes filter down to the Parquet read —
see ParquetVectorReader::read_all_filtered for the row-group skip +
exact RowFilter mechanics.
Sourcepub fn matching_row_ids(
&self,
filter: &ColumnFilter,
) -> AilakeResult<HashSet<u64>>
pub fn matching_row_ids( &self, filter: &ColumnFilter, ) -> AilakeResult<HashSet<u64>>
Returns the set of original (file-relative) row indices matching
filter, without disturbing row identity — see
ParquetVectorReader::matching_row_ids. Use this (not
read_parquet_filtered) wherever the caller also indexes rows by an
externally-computed position (HNSW row_id, deletion vector bitmap).
Sourcepub fn load_fts_blob(&self) -> AilakeResult<Option<Bytes>>
pub fn load_fts_blob(&self) -> AilakeResult<Option<Bytes>>
Load the raw FTS blob from the AILK_FTS section, if present.
Returns Ok(None) when the file has no FTS section (opt-in feature).
The returned bytes can be passed directly to ailake_fts::FtsSearcher::from_blob.
Sourcepub fn verify_integrity(&self) -> AilakeResult<()>
pub fn verify_integrity(&self) -> AilakeResult<()>
Verify the positional invariant: Parquet record_count == index node_count.
Dispatches via load_any_index() (HNSW or IVF-PQ, per header.flags) — unlike
load_index(), which always assumes HNSW and errors out on an IVF-PQ-indexed file.
Auto Trait Implementations§
impl !Freeze for AilakeFileReader
impl RefUnwindSafe for AilakeFileReader
impl Send for AilakeFileReader
impl Sync for AilakeFileReader
impl Unpin for AilakeFileReader
impl UnsafeUnpin for AilakeFileReader
impl UnwindSafe for AilakeFileReader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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>
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 more