Package io.delta.kernel.internal
Class TransactionBuilderImpl
Object
io.delta.kernel.internal.TransactionBuilderImpl
- All Implemented Interfaces:
TransactionBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionBuilderImpl(TableImpl table, String engineInfo, Operation operation) -
Method Summary
Modifier and TypeMethodDescriptionBuild the transaction.withPartitionColumns(Engine engine, List<String> partitionColumns) Set the list of partitions columns when create a new partitioned table.withSchema(Engine engine, StructType newSchema) Set the schema of the table when creating a new table.withTransactionId(Engine engine, String applicationId, long transactionVersion) Set the transaction identifier for idempotent writes.
-
Constructor Details
-
TransactionBuilderImpl
-
-
Method Details
-
withSchema
Description copied from interface:TransactionBuilderSet the schema of the table when creating a new table.- Specified by:
withSchemain interfaceTransactionBuilder- Parameters:
engine-Engineinstance to use.newSchema- The new schema of the table.- Returns:
- updated
TransactionBuilderinstance.
-
withPartitionColumns
Description copied from interface:TransactionBuilderSet the list of partitions columns when create a new partitioned table.- Specified by:
withPartitionColumnsin interfaceTransactionBuilder- Parameters:
engine-Engineinstance to use.partitionColumns- The partition columns of the table. These should be a subset of the columns in the schema.- Returns:
- updated
TransactionBuilderinstance.
-
withTransactionId
public TransactionBuilder withTransactionId(Engine engine, String applicationId, long transactionVersion) Description copied from interface:TransactionBuilderSet 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 Transaction Identifiers.- Specified by:
withTransactionIdin interfaceTransactionBuilder- Parameters:
engine-Engineinstance to use.applicationId- The application ID that is writing to the table.transactionVersion- The version of the transaction. This should be monotonically increasing with each write for the same application ID.- Returns:
- updated
TransactionBuilderinstance.
-
build
Description copied from interface:TransactionBuilderBuild the transaction. Also validates the given info to ensure that a valid transaction can be created.- Specified by:
buildin interfaceTransactionBuilder- Parameters:
engine-Engineinstance to use.
-