Interface CreateTableTransactionBuilder
- All Known Implementing Classes:
CreateTableTransactionBuilderImpl
Transaction to create a new Delta table.- Since:
- 3.4.0
-
Method Summary
Modifier and TypeMethodDescriptionBuild the transaction for creating the Delta table.withCommitter(Committer committer) Provides a custom committer to use at transaction commit time.Set the data layout specification for the new Delta table.withMaxRetries(int maxRetries) Set the maximum number of retries to retry the commit in the case of a retryable error.withTableProperties(Map<String, String> properties) Set table properties for the new Delta table.
-
Method Details
-
withTableProperties
Set table properties for the new Delta table.This method can be called multiple times to add additional properties. If a property key already exists from a previous call with a different value, an
IllegalArgumentExceptionwill be thrown.Note, user-properties (those without a '.delta' prefix) are case-sensitive. Delta-properties are case-insensitive and are normalized to their expected case before writing to the log.
- Parameters:
properties- A map of table property names to their values.- Throws:
IllegalArgumentException- if any property key already exists from a previous call with a different value.
-
withDataLayoutSpec
Set the data layout specification for the new Delta table.The data layout specification determines how data files are organized within the table, such as partitioning and clustering strategies.
The default, if not specified in the builder, is unpartitioned.
- Parameters:
spec- The data layout specification.- See Also:
-
withMaxRetries
Set the maximum number of retries to retry the commit in the case of a retryable error.- Parameters:
maxRetries- The maximum number of retries. Must be at least 0. Default is 200.
-
withCommitter
Provides a custom committer to use at transaction commit time.Catalog implementations that wish to support the catalogManaged Delta table feature should provide to engines their own catalog-specific Committer implementation which may, for example, send a commit RPC to the catalog service to finalize the commit.
If no committer is provided, a default committer will be created that only supports writing into filesystem-managed Delta tables.
- Parameters:
committer- the committer to use- Returns:
- a new builder instance with the provided committer
- See Also:
-
build
Build the transaction for creating the Delta table.This validates all the configuration and creates a
Transactionthat can be used to create the new Delta table. The transaction must be committed usingTransaction.commit(Engine, CloseableIterable)to actually create the table.- Parameters:
engine- TheEngineinstance to use.- Returns:
- A configured
Transactionfor creating the table.
-