pub struct Table { /* private fields */ }Expand description
A table at one committed version. Cheap to clone; call Table::refresh to see newer commits.
Operations that commit (Table::append, Table::maintain) return the new version and
leave self unchanged.
Implementations§
Source§impl Table
impl Table
Sourcepub async fn append(
&self,
batches: &[RecordBatch],
opts: AppendOptions,
) -> Result<(Table, AppendResult)>
pub async fn append( &self, batches: &[RecordBatch], opts: AppendOptions, ) -> Result<(Table, AppendResult)>
Appends Arrow data as one commit. Rows are aligned to the table schema, sorted by
(series_key…, time), and written to one file per time partition. Returns the new table
version.
Source§impl Table
impl Table
Sourcepub async fn maintain(
&self,
opts: MaintainOptions,
) -> Result<(Table, MaintainReport)>
pub async fn maintain( &self, opts: MaintainOptions, ) -> Result<(Table, MaintainReport)>
Runs maintenance: retention, then compaction, then snapshot expiry and file cleanup. Returns the new table version.
Source§impl Table
impl Table
Sourcepub fn metadata(&self) -> &TableMetadata
pub fn metadata(&self) -> &TableMetadata
The Iceberg metadata of this version.
Sourcepub fn contract(&self) -> &Contract
pub fn contract(&self) -> &Contract
The Timelake contract (time column, series key, layout and maintenance policy).
Sourcepub fn schema(&self) -> SchemaRef
pub fn schema(&self) -> SchemaRef
Arrow schema of the table (fields carry Iceberg field ids as PARQUET:field_id metadata).
Sourcepub fn current_snapshot(&self) -> Option<&SnapshotRef>
pub fn current_snapshot(&self) -> Option<&SnapshotRef>
The current snapshot, if anything was ever committed.
Sourcepub fn last_value_index(&self) -> Option<String>
pub fn last_value_index(&self) -> Option<String>
Location of the last-value index for the current snapshot, if the table has one.
Source§impl Table
impl Table
Sourcepub async fn upgrade(
&self,
opts: &UpgradeOptions,
) -> Result<(Table, UpgradeReport)>
pub async fn upgrade( &self, opts: &UpgradeOptions, ) -> Result<(Table, UpgradeReport)>
Brings the table to the current format (FORMAT_VERSION) and layout, without losing
data: every step is a commit, and no snapshot expires for opts.keep_snapshots, so
Table::rollback to report.snapshot_before undoes it. Returns the new version.
Sourcepub async fn rollback(&self, snapshot_id: i64) -> Result<Table>
pub async fn rollback(&self, snapshot_id: i64) -> Result<Table>
Makes snapshot_id, an earlier snapshot of this table, current again: a new version whose
data is that snapshot’s. Later snapshots stay in the history until they expire, so a
rollback can be rolled back too. Returns the new version.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Table
impl !UnwindSafe for Table
impl Freeze for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin for Table
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast 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