pub struct TableWriter { /* private fields */ }Implementations§
Source§impl TableWriter
impl TableWriter
pub fn new( catalog: Arc<dyn CatalogProvider>, store: Arc<dyn Store>, policy: VectorStoragePolicy, table: TableIdent, ) -> Self
pub fn with_parent_snapshot(self, id: SnapshotId) -> Self
Sourcepub async fn write_batch_deferred(
&mut self,
batch: &RecordBatch,
embeddings: &[Vec<f32>],
) -> AilakeResult<()>
pub async fn write_batch_deferred( &mut self, batch: &RecordBatch, embeddings: &[Vec<f32>], ) -> AilakeResult<()>
Write batch as Parquet-only immediately, build HNSW in background.
Returns after the Parquet file is persisted (~LanceDB write speed). A tokio task runs concurrently to build the HNSW index, rewrite the file with the AILK section, and update the catalog entry.
During the build window, SearchSession serves this shard via flat scan
(brute-force, exact) instead of HNSW. The transition is automatic once
the background task commits the updated manifest entry.
Sourcepub async fn write_batch(
&mut self,
batch: &RecordBatch,
embeddings: &[Vec<f32>],
) -> AilakeResult<()>
pub async fn write_batch( &mut self, batch: &RecordBatch, embeddings: &[Vec<f32>], ) -> AilakeResult<()>
Write a batch to a new AI-Lake file and stage it for commit.
Sourcepub async fn write_batch_auto(
&mut self,
batch: &RecordBatch,
embeddings: &[Vec<f32>],
) -> AilakeResult<()>
pub async fn write_batch_auto( &mut self, batch: &RecordBatch, embeddings: &[Vec<f32>], ) -> AilakeResult<()>
Write batch, auto-selecting the index based on detected hardware.
Picks IVF-PQ when a CUDA GPU or ≥8 CPU cores are present AND the batch
has ≥5 000 vectors. Falls back to HNSW for weaker / local hardware.
Uses IvfPqConfig::for_dataset to scale nlist with dataset size.
Sourcepub async fn write_batch_ivf_pq(
&mut self,
batch: &RecordBatch,
embeddings: &[Vec<f32>],
ivf_config: IvfPqConfig,
) -> AilakeResult<()>
pub async fn write_batch_ivf_pq( &mut self, batch: &RecordBatch, embeddings: &[Vec<f32>], ivf_config: IvfPqConfig, ) -> AilakeResult<()>
Write batch with IVF-PQ index built synchronously (no background task).
Smaller index than HNSW; better for S3 sequential-scan workloads.
Sourcepub async fn write_batch_multi(
&mut self,
batch: &RecordBatch,
columns: &[MultiVectorBatch<'_>],
) -> AilakeResult<()>
pub async fn write_batch_multi( &mut self, batch: &RecordBatch, columns: &[MultiVectorBatch<'_>], ) -> AilakeResult<()>
Write a batch with multiple vector columns into a single AI-Lake file.
The first entry in columns is treated as the primary column (used for
geometric pruning). Additional columns each get their own HNSW section.
Sourcepub async fn commit(self) -> AilakeResult<SnapshotId>
pub async fn commit(self) -> AilakeResult<SnapshotId>
Commit all staged files as a new Iceberg snapshot.
Sourcepub async fn create_or_open(
catalog: Arc<dyn CatalogProvider>,
store: Arc<dyn Store>,
policy: VectorStoragePolicy,
table: TableIdent,
) -> AilakeResult<Self>
pub async fn create_or_open( catalog: Arc<dyn CatalogProvider>, store: Arc<dyn Store>, policy: VectorStoragePolicy, table: TableIdent, ) -> AilakeResult<Self>
Create a table if it doesn’t exist, then return a writer for it.
Auto Trait Implementations§
impl Freeze for TableWriter
impl !RefUnwindSafe for TableWriter
impl Send for TableWriter
impl Sync for TableWriter
impl Unpin for TableWriter
impl UnsafeUnpin for TableWriter
impl !UnwindSafe for TableWriter
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
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