pub struct MaterializedView { /* private fields */ }
Expand description
A materialized view in Apache Iceberg that maintains a physical copy of query results in a storage table. The view provides ACID guarantees and can be refreshed to stay in sync with changes in the source tables.
The materialized view consists of:
- A view definition (SQL or other representation)
- A storage table containing the materialized data
- Metadata tracking the freshness state relative to source tables
Implementations§
Source§impl MaterializedView
Public interface of the table.
impl MaterializedView
Public interface of the table.
Sourcepub fn builder() -> CreateMaterializedViewBuilder
pub fn builder() -> CreateMaterializedViewBuilder
Creates a new builder for configuring and creating a materialized view
Returns a CreateMaterializedViewBuilder
that provides a fluent interface for:
- Setting the view name and location
- Configuring view properties
- Defining the view schema and SQL representation
- Specifying the catalog and storage table settings
Sourcepub async fn new(
identifier: Identifier,
catalog: Arc<dyn Catalog>,
metadata: MaterializedViewMetadata,
) -> Result<Self, Error>
pub async fn new( identifier: Identifier, catalog: Arc<dyn Catalog>, metadata: MaterializedViewMetadata, ) -> Result<Self, Error>
Creates a new materialized view instance with the given identifier, catalog and metadata
§Arguments
identifier
- The unique identifier for this view in the catalogcatalog
- The catalog that will store this view’s metadatametadata
- The view metadata containing schema, properties, etc.
§Returns
Result<MaterializedView, Error>
- The created materialized view or an error
Sourcepub fn identifier(&self) -> &Identifier
pub fn identifier(&self) -> &Identifier
Returns the unique identifier for this materialized view in the catalog
The identifier contains the namespace and name that uniquely identify this view within its catalog
Sourcepub fn catalog(&self) -> Arc<dyn Catalog>
pub fn catalog(&self) -> Arc<dyn Catalog>
Returns a reference to the catalog that stores this materialized view
The catalog manages the view’s metadata and provides ACID guarantees for operations on the view
Sourcepub fn metadata(&self) -> &MaterializedViewMetadata
pub fn metadata(&self) -> &MaterializedViewMetadata
Returns a reference to this materialized view’s metadata
The metadata contains the view’s schema, properties, version history, and other configuration details as defined by the Apache Iceberg spec
Sourcepub fn new_transaction(
&mut self,
branch: Option<&str>,
) -> MaterializedViewTransaction<'_>
pub fn new_transaction( &mut self, branch: Option<&str>, ) -> MaterializedViewTransaction<'_>
Sourcepub async fn storage_table(&self) -> Result<StorageTable, Error>
pub async fn storage_table(&self) -> Result<StorageTable, Error>
Returns the storage table that contains the materialized data for this view
The storage table is a regular Iceberg table that stores the physical data for this materialized view. It is managed internally by the view and should not be modified directly.
§Returns
Result<StorageTable, Error>
- The storage table or an error if it cannot be loaded
Trait Implementations§
Source§impl Clone for MaterializedView
impl Clone for MaterializedView
Source§fn clone(&self) -> MaterializedView
fn clone(&self) -> MaterializedView
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for MaterializedView
impl !RefUnwindSafe for MaterializedView
impl Send for MaterializedView
impl Sync for MaterializedView
impl Unpin for MaterializedView
impl !UnwindSafe for MaterializedView
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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