pub struct RowDeltaAction { /* private fields */ }Expand description
RowDeltaAction is a transaction action for encoding row-level changes to a table.
This action supports:
- Adding new data files
- Adding delete files (both position and equality deletes)
This is the appropriate action to use for:
- CDC (Change Data Capture) ingestion
- Upsert operations
- Row-level deletions
§Example
ⓘ
use iceberg::transaction::Transaction;
let tx = Transaction::new(&table);
let action = tx.row_delta()
.add_data_files(new_data_files)
.add_delete_files(equality_delete_files);
let tx = action.apply(tx).unwrap();
let table = tx.commit(&catalog).await.unwrap();Implementations§
Source§impl RowDeltaAction
impl RowDeltaAction
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new row delta action. Equivalent to crate::transaction::Transaction::row_delta.
Sourcepub fn with_check_duplicate(self, v: bool) -> Self
pub fn with_check_duplicate(self, v: bool) -> Self
Set whether to check duplicate files
Sourcepub fn add_data_files(
self,
data_files: impl IntoIterator<Item = DataFile>,
) -> Self
pub fn add_data_files( self, data_files: impl IntoIterator<Item = DataFile>, ) -> Self
Add data files to the snapshot.
Sourcepub fn add_delete_files(
self,
delete_files: impl IntoIterator<Item = DataFile>,
) -> Self
pub fn add_delete_files( self, delete_files: impl IntoIterator<Item = DataFile>, ) -> Self
Add delete files to the snapshot.
Delete files can be either position deletes or equality deletes. The content type of each file will be validated.
Sourcepub fn set_commit_uuid(self, commit_uuid: Uuid) -> Self
pub fn set_commit_uuid(self, commit_uuid: Uuid) -> Self
Set commit UUID for the snapshot.
Sourcepub fn set_snapshot_properties(
self,
snapshot_properties: HashMap<String, String>,
) -> Self
pub fn set_snapshot_properties( self, snapshot_properties: HashMap<String, String>, ) -> Self
Set snapshot summary properties.
Trait Implementations§
Source§impl Default for RowDeltaAction
impl Default for RowDeltaAction
Source§impl TransactionAction for RowDeltaAction
impl TransactionAction for RowDeltaAction
Source§fn commit<'life0, 'async_trait>(
self: Arc<Self>,
table: &'life0 Table,
) -> Pin<Box<dyn Future<Output = Result<ActionCommit>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn commit<'life0, 'async_trait>(
self: Arc<Self>,
table: &'life0 Table,
) -> Pin<Box<dyn Future<Output = Result<ActionCommit>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Commits this action against the provided table and returns the resulting updates.
NOTE: Most users should apply actions through
Transaction, which handles
rebasing onto the latest table state and retrying on commit conflicts. Call
this directly only to take over that responsibility yourself, passing the
resulting updates and requirements to Catalog::update_table via
TableCommit. Read moreAuto Trait Implementations§
impl Freeze for RowDeltaAction
impl RefUnwindSafe for RowDeltaAction
impl Send for RowDeltaAction
impl Sync for RowDeltaAction
impl Unpin for RowDeltaAction
impl UnsafeUnpin for RowDeltaAction
impl UnwindSafe for RowDeltaAction
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> ApplyTransactionAction for Twhere
T: TransactionAction + 'static,
impl<T> ApplyTransactionAction for Twhere
T: TransactionAction + 'static,
Source§fn apply(self, tx: Transaction) -> Result<Transaction, Error>where
T: Sized,
fn apply(self, tx: Transaction) -> Result<Transaction, Error>where
T: Sized,
Adds this action to the given transaction. Read more
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
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for T
impl<T> Downcast 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> ⓘ
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 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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more