pub struct ViewBuilder { /* private fields */ }
Expand description

Builder pattern to create a view

Implementations§

source§

impl ViewBuilder

source

pub fn new( sql: impl ToString, identifier: impl ToString, schema: Schema, catalog: Arc<dyn Catalog> ) -> Result<Self, Error>

Creates a new [TableBuilder] to create a Metastore view with some default metadata entries already set.

source

pub async fn build(self) -> Result<View, Error>

Building a table writes the metadata file and commits the table to either the metastore or the filesystem

Methods from Deref<Target = ViewMetadataBuilder>§

source

pub fn view_uuid(&mut self, value: Uuid) -> &mut GeneralViewMetadataBuilder<T>

A UUID that identifies the view, generated when the view is created. Implementations must throw an exception if a view’s UUID does not match the expected UUID after refreshing metadata

source

pub fn format_version( &mut self, value: FormatVersion ) -> &mut GeneralViewMetadataBuilder<T>

An integer version number for the view format; must be 1

source

pub fn location<VALUE>( &mut self, value: VALUE ) -> &mut GeneralViewMetadataBuilder<T>
where VALUE: Into<String>,

The view’s base location. This is used to determine where to store manifest files and view metadata files.

source

pub fn current_version_id( &mut self, value: i64 ) -> &mut GeneralViewMetadataBuilder<T>

Current version of the view. Set to ‘1’ when the view is first created.

source

pub fn versions( &mut self, value: HashMap<i64, Version> ) -> &mut GeneralViewMetadataBuilder<T>

An array of structs describing the last known versions of the view. Controlled by the table property: “version.history.num-entries”. See section Versions.

source

pub fn with_version<VALUE>( &mut self, item: VALUE ) -> &mut GeneralViewMetadataBuilder<T>
where HashMap<i64, Version>: Default + Extend<VALUE>,

An array of structs describing the last known versions of the view. Controlled by the table property: “version.history.num-entries”. See section Versions.

source

pub fn version_log( &mut self, value: Vec<VersionLogStruct> ) -> &mut GeneralViewMetadataBuilder<T>

A list of timestamp and version ID pairs that encodes changes to the current version for the view. Each time the current-version-id is changed, a new entry should be added with the last-updated-ms and the new current-version-id.

source

pub fn schemas( &mut self, value: HashMap<i32, Schema> ) -> &mut GeneralViewMetadataBuilder<T>

A list of schemas, the same as the ‘schemas’ field from Iceberg table spec.

source

pub fn with_schema<VALUE>( &mut self, item: VALUE ) -> &mut GeneralViewMetadataBuilder<T>
where HashMap<i32, Schema>: Default + Extend<VALUE>,

A list of schemas, the same as the ‘schemas’ field from Iceberg table spec.

source

pub fn properties( &mut self, value: ViewProperties<T> ) -> &mut GeneralViewMetadataBuilder<T>

A string to string map of view properties. This is used for metadata such as “comment” and for settings that affect view maintenance. This is not intended to be used for arbitrary metadata.

source

pub fn build( &self ) -> Result<GeneralViewMetadata<T>, GeneralViewMetadataBuilderError>

Builds a new GeneralViewMetadata.

§Errors

If a required field has not been initialized.

Trait Implementations§

source§

impl Deref for ViewBuilder

§

type Target = GeneralViewMetadataBuilder<Option<()>>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for ViewBuilder

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

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> 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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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