pub struct AlterTableTransactionBuilder<S = Ready> { /* private fields */ }internal-api only.Expand description
Builder for constructing an AlterTableTransaction with schema evolution operations.
Uses a type-state pattern (S) to enforce at compile time:
- At least one schema operation must be queued before
build()is callable. - Only operations valid for the current state can be chained. This will disallow incompatible chaining.
Implementations§
Source§impl<S> AlterTableTransactionBuilder<S>
impl<S> AlterTableTransactionBuilder<S>
Sourcepub fn with_correlation_id(self, correlation_id: impl Into<Arc<str>>) -> Self
pub fn with_correlation_id(self, correlation_id: impl Into<Arc<str>>) -> Self
Attach an opaque, caller-supplied correlation id for joining the alter-table commit’s metric events to the caller’s own request or operation id. An empty id is treated as unset.
Source§impl<S: Chainable> AlterTableTransactionBuilder<S>
impl<S: Chainable> AlterTableTransactionBuilder<S>
Sourcepub fn add_column(
self,
field: StructField,
) -> AlterTableTransactionBuilder<Modifying>
pub fn add_column( self, field: StructField, ) -> AlterTableTransactionBuilder<Modifying>
Add a new top-level column to the table schema.
The field must not already exist in the schema (case-insensitive). The field must be
nullable because existing data files do not contain this column and will read NULL for it.
field and any of its nested fields must not carry delta.columnMapping.id or
delta.columnMapping.physicalName annotations.
These constraints are validated during build().
Sourcepub fn set_nullable(
self,
column: ColumnName,
) -> AlterTableTransactionBuilder<Modifying>
pub fn set_nullable( self, column: ColumnName, ) -> AlterTableTransactionBuilder<Modifying>
Change a column’s nullability from NOT NULL to nullable. If the column is already nullable, the op is a no-op but still generates a commit.
Note: this matches Spark’s behavior.
Source§impl AlterTableTransactionBuilder<Modifying>
impl AlterTableTransactionBuilder<Modifying>
Sourcepub fn build(
self,
_engine: &dyn Engine,
committer: Box<dyn Committer>,
) -> DeltaResult<AlterTableTransaction>
pub fn build( self, _engine: &dyn Engine, committer: Box<dyn Committer>, ) -> DeltaResult<AlterTableTransaction>
Validate and apply schema operations, then build the AlterTableTransaction.
This method:
- Validates the table supports writes
- Applies each operation sequentially against the evolving schema
- Constructs new Metadata action with evolved schema
- Builds the evolved table configuration
- Creates the transaction
§Errors
- The table enables
icebergCompatV3orallowColumnDefaults, which ALTER TABLE does not yet support - Any individual operation fails validation (see per-method errors above)
- Table does not support writes (unsupported features)
- The evolved schema requires protocol features not enabled on the table (e.g. adding a
timestampNtzcolumn without thetimestampNtzfeature)
Auto Trait Implementations§
impl<S = Ready> !RefUnwindSafe for AlterTableTransactionBuilder<S>
impl<S = Ready> !UnwindSafe for AlterTableTransactionBuilder<S>
impl<S> Freeze for AlterTableTransactionBuilder<S>
impl<S> Send for AlterTableTransactionBuilder<S>where
S: Send,
impl<S> Sync for AlterTableTransactionBuilder<S>where
S: Sync,
impl<S> Unpin for AlterTableTransactionBuilder<S>where
S: Unpin,
impl<S> UnsafeUnpin for AlterTableTransactionBuilder<S>
Blanket Implementations§
Source§impl<T> AsAny for T
impl<T> AsAny for T
Source§fn any_ref(&self) -> &(dyn Any + Send + Sync + 'static)
fn any_ref(&self) -> &(dyn Any + Send + Sync + 'static)
dyn Any reference to the object: Read moreSource§fn as_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ
fn as_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ
Arc<dyn Any> reference to the object: Read moreSource§fn into_any(self: Box<T>) -> Box<dyn Any + Send + Sync>
fn into_any(self: Box<T>) -> Box<dyn Any + Send + Sync>
Box<dyn Any>: Read moreSource§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
std::any::type_name, since Any does not provide it and
Any::type_id is useless as a debugging aid (its Debug is just a mess of hex digits).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> FoldWithOption for T
impl<T> FoldWithOption 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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<KernelType, ArrowType> TryIntoArrow<ArrowType> for KernelTypewhere
ArrowType: TryFromKernel<KernelType>,
impl<KernelType, ArrowType> TryIntoArrow<ArrowType> for KernelTypewhere
ArrowType: TryFromKernel<KernelType>,
Source§fn try_into_arrow(self) -> Result<ArrowType, ArrowError>
fn try_into_arrow(self) -> Result<ArrowType, ArrowError>
arrow-conversion and (crate features arrow-conversion or declarative-plans or default-engine-base) only.Source§impl<KernelType, ArrowType> TryIntoKernel<KernelType> for ArrowTypewhere
KernelType: TryFromArrow<ArrowType>,
impl<KernelType, ArrowType> TryIntoKernel<KernelType> for ArrowTypewhere
KernelType: TryFromArrow<ArrowType>,
Source§fn try_into_kernel(self) -> Result<KernelType, ArrowError>
fn try_into_kernel(self) -> Result<KernelType, ArrowError>
arrow-conversion and (crate features arrow-conversion or declarative-plans or default-engine-base) only.