Package org.apache.iceberg.catalog
Interface Catalog.TableBuilder
-
- All Known Implementing Classes:
BaseMetastoreCatalog.BaseMetastoreCatalogTableBuilder
,BaseMetastoreViewCatalog.BaseMetastoreViewCatalogTableBuilder
,JdbcCatalog.ViewAwareTableBuilder
- Enclosing interface:
- Catalog
public static interface Catalog.TableBuilder
A builder used to create validtables
or start create/replacetransactions
.Call
Catalog.buildTable(TableIdentifier, Schema)
to create a new builder.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Table
create()
Creates the table.Transaction
createOrReplaceTransaction()
Starts a transaction to create or replace the table.Transaction
createTransaction()
Starts a transaction to create the table.Transaction
replaceTransaction()
Starts a transaction to replace the table.Catalog.TableBuilder
withLocation(java.lang.String location)
Sets a location for the table.Catalog.TableBuilder
withPartitionSpec(PartitionSpec spec)
Sets a partition spec for the table.Catalog.TableBuilder
withProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Adds key/value properties to the table.Catalog.TableBuilder
withProperty(java.lang.String key, java.lang.String value)
Adds a key/value property to the table.Catalog.TableBuilder
withSortOrder(SortOrder sortOrder)
Sets a sort order for the table.
-
-
-
Method Detail
-
withPartitionSpec
Catalog.TableBuilder withPartitionSpec(PartitionSpec spec)
Sets a partition spec for the table.- Parameters:
spec
- a partition spec- Returns:
- this for method chaining
-
withSortOrder
Catalog.TableBuilder withSortOrder(SortOrder sortOrder)
Sets a sort order for the table.- Parameters:
sortOrder
- a sort order- Returns:
- this for method chaining
-
withLocation
Catalog.TableBuilder withLocation(java.lang.String location)
Sets a location for the table.- Parameters:
location
- a location- Returns:
- this for method chaining
-
withProperties
Catalog.TableBuilder withProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Adds key/value properties to the table.- Parameters:
properties
- key/value properties- Returns:
- this for method chaining
-
withProperty
Catalog.TableBuilder withProperty(java.lang.String key, java.lang.String value)
Adds a key/value property to the table.- Parameters:
key
- a keyvalue
- a value- Returns:
- this for method chaining
-
create
Table create()
Creates the table.- Returns:
- the created table
-
createTransaction
Transaction createTransaction()
Starts a transaction to create the table.- Returns:
- the
Transaction
to create the table
-
replaceTransaction
Transaction replaceTransaction()
Starts a transaction to replace the table.- Returns:
- the
Transaction
to replace the table
-
createOrReplaceTransaction
Transaction createOrReplaceTransaction()
Starts a transaction to create or replace the table.- Returns:
- the
Transaction
to create or replace the table
-
-