Class TransactionBuilderImpl

Object
io.delta.kernel.internal.TransactionBuilderImpl
All Implemented Interfaces:
TransactionBuilder

public class TransactionBuilderImpl extends Object implements TransactionBuilder
  • Constructor Details

  • Method Details

    • withSchema

      public TransactionBuilder withSchema(Engine engine, StructType newSchema)
      Description copied from interface: TransactionBuilder
      Set the schema of the table when creating a new table.
      Specified by:
      withSchema in interface TransactionBuilder
      Parameters:
      engine - Engine instance to use.
      newSchema - The new schema of the table.
      Returns:
      updated TransactionBuilder instance.
    • withPartitionColumns

      public TransactionBuilder withPartitionColumns(Engine engine, List<String> partitionColumns)
      Description copied from interface: TransactionBuilder
      Set the list of partitions columns when create a new partitioned table.
      Specified by:
      withPartitionColumns in interface TransactionBuilder
      Parameters:
      engine - Engine instance to use.
      partitionColumns - The partition columns of the table. These should be a subset of the columns in the schema.
      Returns:
      updated TransactionBuilder instance.
    • withTransactionId

      public TransactionBuilder withTransactionId(Engine engine, String applicationId, long transactionVersion)
      Description copied from interface: TransactionBuilder
      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 Transaction Identifiers.
      Specified by:
      withTransactionId in interface TransactionBuilder
      Parameters:
      engine - Engine instance 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 TransactionBuilder instance.
    • build

      public Transaction build(Engine engine)
      Description copied from interface: TransactionBuilder
      Build the transaction. Also validates the given info to ensure that a valid transaction can be created.
      Specified by:
      build in interface TransactionBuilder
      Parameters:
      engine - Engine instance to use.