Struct View

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

An Iceberg view provides a logical view over underlying data with schema evolution and versioning

Views store:

  • SQL query or other representation of the view logic
  • Schema evolution history
  • Version history for view definitions
  • Properties for configuration
  • Metadata about view location and catalog

Views can be either filesystem-based or managed by a metastore catalog. They support transactions for atomic updates to their definition and properties.

The View struct provides the main interface for:

  • Creating and managing views
  • Accessing view metadata and schemas
  • Starting transactions for atomic updates
  • Interacting with the underlying storage system

Implementations§

Source§

impl View

Public interface of the table.

Source

pub fn builder() -> CreateViewBuilder<Option<()>>

Creates a new builder for configuring and creating an Iceberg view

Returns a CreateViewBuilder that provides a fluent interface for:

  • Setting the view name and location
  • Configuring view properties
  • Defining the view schema
  • Setting SQL or other view representations
  • Specifying the catalog and namespace
§Returns
  • CreateViewBuilder<Option<()>> - A builder for creating new views
Source

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

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

§Arguments
  • identifier - The unique identifier for this view in the catalog
  • catalog - The catalog that will manage this view
  • metadata - The view metadata containing schema, versions, and other view information
§Returns
  • Result<Self, Error> - The new view instance or an error if creation fails

This is typically called by catalog implementations rather than directly by users. For creating new views, use the builder() method instead.

Source

pub fn identifier(&self) -> &Identifier

Gets the unique identifier for this view in the catalog

The identifier contains:

  • The namespace path for the view
  • The view name
§Returns
  • &Identifier - A reference to this view’s identifier
Source

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

Gets the catalog that manages this view

The catalog handles:

  • View metadata storage and retrieval
  • Schema management
  • View versioning
  • Access control
§Returns
  • Arc<dyn Catalog> - A thread-safe reference to the catalog
Source

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

Gets the object store for this view’s storage location

The object store provides:

  • Access to the underlying storage system (S3, local filesystem, etc)
  • Read/write operations for view data and metadata
  • Storage-specific configuration and credentials
§Returns
  • Arc<dyn ObjectStore> - A thread-safe reference to the configured object store
Source

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

Gets the current schema for this view, 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 for the view/branch, or an error if not found

The schema defines the structure of the view’s output, including:

  • Column names and types
  • Column IDs and documentation
  • Whether columns are required/optional
Source

pub fn metadata(&self) -> &ViewMetadata

Gets the underlying view metadata that defines this view

The metadata contains:

  • View UUID and format version
  • Storage location information
  • Version history and schema evolution
  • View properties and configurations
  • SQL representations and other view definitions
§Returns
  • &ViewMetadata - A reference to the view’s metadata
Source

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

Creates a new transaction for performing atomic updates to this view

§Arguments
  • branch - Optional branch name to create the transaction for. If None, uses the main branch
§Returns
  • ViewTransaction - A new transaction that can be used to:
    • Update view representations and schemas
    • Modify view properties
    • Commit changes atomically

Transactions ensure that all changes are applied atomically with ACID guarantees. Multiple operations can be chained and will be committed together.

Trait Implementations§

Source§

impl Clone for View

Source§

fn clone(&self) -> View

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 View

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for View

§

impl !RefUnwindSafe for View

§

impl Send for View

§

impl Sync for View

§

impl Unpin for View

§

impl !UnwindSafe for View

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,