You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Kernel][Writes] Support idempotent writes (#3051)
## Description
(Split from #2944)
Adds an API on `TransactionBuilder` to take the transaction identifier
for idempotent writes
```
/*
* Set the transaction identifier for idempotent writes. Incremental processing systems (e.g.,
* streaming systems) that track progress using their own application-specific versions need to
* record what progress has been made, in order to avoid duplicating data in the face of
* failures and retries during writes. By setting the transaction identifier, the Delta table
* can ensure that the data with same identifier is not written multiple times. For more
* information refer to the Delta protocol section <a
* href="https://github.com/delta-io/delta/blob/master/PROTOCOL.md#transaction-identifiers">
* Transaction Identifiers</a>.
*
* @param engine {@link Engine} instance to use.
* @param applicationId The application ID that is writing to the table.
* @param transactionVersion The version of the transaction. This should be monotonically
* increasing with each write for the same application ID.
* @return updated {@link TransactionBuilder} instance.
*/
TransactionBuilder withTransactionId(
Engine engine,
String applicationId,
long transactionVersion);
```
During the transaction build, check the latest txn version of the given
AppId. If it is not monotonically increasing throw
`ConcurrentTransactionException`.
## How was this patch tested?
Added to `DeltaTableWriteSuite.scala`
0 commit comments