Struct Table

Source
pub struct Table { /* private fields */ }
Expand description

Iceberg table

Implementations§

Source§

impl Table

Public interface of the table.

Source

pub fn builder() -> CreateTableBuilder

Creates a new table builder with default configuration

Returns a CreateTableBuilder initialized with default properties:

  • WRITE_PARQUET_COMPRESSION_CODEC: “zstd”
  • WRITE_PARQUET_COMPRESSION_LEVEL: “1”
  • WRITE_OBJECT_STORAGE_ENABLED: “false”
§Returns
  • CreateTableBuilder - A builder for configuring and creating a new table
§Example
use iceberg_rust::table::Table;

let builder = Table::builder()
    .with_name("my_table")
    .with_schema(schema);
Source

pub async fn new( identifier: Identifier, catalog: Arc<dyn Catalog>, metadata: TableMetadata, ) -> Result<Self, Error>

Creates a new table instance with the given identifier, catalog and metadata

§Arguments
  • identifier - The unique identifier for this table in the catalog
  • catalog - The catalog that this table belongs to
  • metadata - The table’s metadata containing schema, partitioning, etc.
§Returns
  • Result<Table, Error> - The newly created table instance or an error

This is typically called by catalog implementations rather than directly by users. For creating new tables, use Table::builder() instead.

Source

pub fn identifier(&self) -> &Identifier

Returns the unique identifier for this table in the catalog

The identifier contains both the namespace and name that uniquely identify this table within its catalog.

§Returns
  • &Identifier - A reference to this table’s identifier
Source

pub fn catalog(&self) -> Arc<dyn Catalog>

Returns a reference to the catalog containing this table

The returned catalog reference is wrapped in an Arc to allow shared ownership and thread-safe access to the catalog implementation.

§Returns
  • Arc<dyn Catalog> - A thread-safe reference to the table’s catalog
Source

pub fn object_store(&self) -> Arc<dyn ObjectStore>

Returns the object store for this table’s location

The object store is determined by the table’s location and is used for reading and writing table data files. The returned store is wrapped in an Arc to allow shared ownership and thread-safe access.

§Returns
  • Arc<dyn ObjectStore> - A thread-safe reference to the table’s object store
Source

pub fn current_schema(&self, branch: Option<&str>) -> Result<&Schema, Error>

Returns the current schema for this table, optionally for a specific branch

§Arguments
  • branch - Optional branch name to get the schema for. If None, returns the main branch schema
§Returns
  • Result<&Schema, Error> - The current schema if found, or an error if the schema cannot be found
§Errors

Returns an error if the schema ID cannot be found in the table metadata

Source

pub fn metadata(&self) -> &TableMetadata

Returns a reference to this table’s metadata

The metadata contains all table information including:

  • Schema definitions
  • Partition specifications
  • Snapshots
  • Sort orders
  • Table properties
§Returns
  • &TableMetadata - A reference to the table’s metadata
Source

pub fn into_metadata(self) -> TableMetadata

Consumes the table and returns its metadata

This method takes ownership of the table instance and returns just the underlying TableMetadata. This is useful when you no longer need the table instance but want to retain its metadata.

§Returns
  • TableMetadata - The owned metadata from this table
Source

pub async fn manifests( &self, start: Option<i64>, end: Option<i64>, ) -> Result<Vec<ManifestListEntry>, Error>

Returns manifest list entries for snapshots within the given sequence range

§Arguments
  • start - Optional starting snapshot ID (exclusive). If None, includes from the beginning
  • end - Optional ending snapshot ID (inclusive). If None, uses the current snapshot
§Returns
  • Result<Vec<ManifestListEntry>, Error> - Vector of manifest entries in the range, or an empty vector if no current snapshot exists
§Errors

Returns an error if:

  • The end snapshot ID is invalid
  • Reading the manifest list fails
Source

pub async fn datafiles<'a>( &self, manifests: &'a [ManifestListEntry], filter: Option<Vec<bool>>, sequence_number_range: (Option<i64>, Option<i64>), ) -> Result<impl Stream<Item = Result<ManifestEntry, Error>> + 'a, Error>

Returns a stream of manifest entries for the given manifest list entries

§Arguments
  • manifests - List of manifest entries to read data files from
  • filter - Optional vector of boolean predicates to filter manifest entries
  • sequence_number_range - Tuple of (start, end) sequence numbers to filter entries by
§Returns
  • Result<impl Stream<Item = Result<ManifestEntry, Error>>, Error> - Stream of manifest entries that match the given filters
§Type Parameters
  • 'a - Lifetime of the manifest list entries reference
§Errors

Returns an error if reading any manifest file fails

Source

pub async fn datafiles_contains_delete( &self, start: Option<i64>, end: Option<i64>, ) -> Result<bool, Error>

Check if datafiles contain deletes

Source

pub fn new_transaction(&mut self, branch: Option<&str>) -> TableTransaction<'_>

Creates a new transaction for atomic modifications to this table

§Arguments
  • branch - Optional branch name to create the transaction for. If None, uses the main branch
§Returns
  • TableTransaction - A new transaction that can be used to atomically modify this table

The transaction must be committed for any changes to take effect. Multiple operations can be chained within a single transaction.

Trait Implementations§

Source§

impl Clone for Table

Source§

fn clone(&self) -> Table

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Table

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Table

§

impl !RefUnwindSafe for Table

§

impl Send for Table

§

impl Sync for Table

§

impl Unpin for Table

§

impl !UnwindSafe for Table

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,