public interface TableCatalog
Modifier and Type | Method and Description |
---|---|
Table |
alterTable(NameIdentifier ident,
TableChange... changes)
Apply the
change to a table in the catalog. |
default Table |
createTable(NameIdentifier ident,
Column[] columns,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties)
Create a table in the catalog.
|
default Table |
createTable(NameIdentifier ident,
Column[] columns,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties,
Distribution distribution)
Create a table in the catalog.
|
default Table |
createTable(NameIdentifier ident,
Column[] columns,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties,
Distribution distribution,
SortOrder[] sortOrders)
Create a table in the catalog.
|
default Table |
createTable(NameIdentifier ident,
Column[] columns,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties,
SortOrder[] sortOrders)
Create a table in the catalog.
|
default Table |
createTable(NameIdentifier ident,
Column[] columns,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties,
Transform[] partitions)
Create a table in the catalog.
|
default Table |
createTable(NameIdentifier ident,
Column[] columns,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties,
Transform[] partitions,
Distribution distribution,
SortOrder[] sortOrders)
Create a partitioned table in the catalog.
|
Table |
createTable(NameIdentifier ident,
Column[] columns,
java.lang.String comment,
java.util.Map<java.lang.String,java.lang.String> properties,
Transform[] partitions,
Distribution distribution,
SortOrder[] sortOrders,
Index[] indexes)
Create a table in the catalog.
|
boolean |
dropTable(NameIdentifier ident)
Removes both the metadata and the directory associated with the table from the file system if
the table is not an external table.
|
NameIdentifier[] |
listTables(Namespace namespace)
List the tables in a namespace from the catalog.
|
Table |
loadTable(NameIdentifier ident)
Load table metadata by
NameIdentifier from the catalog. |
default boolean |
purgeTable(NameIdentifier ident)
Drop a table from the catalog and completely remove its data.
|
default boolean |
tableExists(NameIdentifier ident)
Check if a table exists using an
NameIdentifier from the catalog. |
NameIdentifier[] listTables(Namespace namespace) throws NoSuchSchemaException
namespace
- A namespace.NoSuchSchemaException
- If the schema does not exist.Table loadTable(NameIdentifier ident) throws NoSuchTableException
NameIdentifier
from the catalog.ident
- A table identifier.NoSuchTableException
- If the table does not exist.default boolean tableExists(NameIdentifier ident)
NameIdentifier
from the catalog.ident
- A table identifier.default Table createTable(NameIdentifier ident, Column[] columns, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties) throws NoSuchSchemaException, TableAlreadyExistsException
ident
- A table identifier.columns
- The columns of the new table.comment
- The table comment.properties
- The table properties.NoSuchSchemaException
- If the schema does not exist.TableAlreadyExistsException
- If the table already exists.default Table createTable(NameIdentifier ident, Column[] columns, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties, Transform[] partitions) throws NoSuchSchemaException, TableAlreadyExistsException
ident
- A table identifier.columns
- The columns of the new table.comment
- The table comment.properties
- The table properties.partitions
- The table partitioning.NoSuchSchemaException
- If the schema does not exist.TableAlreadyExistsException
- If the table already exists.default Table createTable(NameIdentifier ident, Column[] columns, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties, Distribution distribution, SortOrder[] sortOrders) throws NoSuchSchemaException, TableAlreadyExistsException
ident
- A table identifier.columns
- The columns of the new table.comment
- The table comment.properties
- The table properties.distribution
- The distribution of the tablesortOrders
- The sort orders of the tableNoSuchSchemaException
- If the schema does not exist.TableAlreadyExistsException
- If the table already exists.default Table createTable(NameIdentifier ident, Column[] columns, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties, Distribution distribution) throws NoSuchSchemaException, TableAlreadyExistsException
ident
- A table identifier.columns
- The columns of the new table.comment
- The table comment.properties
- The table properties.distribution
- The distribution of the table.NoSuchSchemaException
- If the schema does not exist.TableAlreadyExistsException
- If the table already exists.default Table createTable(NameIdentifier ident, Column[] columns, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties, SortOrder[] sortOrders) throws NoSuchSchemaException, TableAlreadyExistsException
ident
- A table identifier.columns
- The columns of the new table.comment
- The table comment.properties
- The table properties.sortOrders
- The sort orders of the tableNoSuchSchemaException
- If the schema does not exist.TableAlreadyExistsException
- If the table already exists.default Table createTable(NameIdentifier ident, Column[] columns, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties, Transform[] partitions, Distribution distribution, SortOrder[] sortOrders) throws NoSuchSchemaException, TableAlreadyExistsException
ident
- A table identifier.columns
- The columns of the new table.comment
- The table comment.properties
- The table properties.distribution
- The distribution of the tablesortOrders
- The sort orders of the tablepartitions
- The table partitioning.NoSuchSchemaException
- If the schema does not exist.TableAlreadyExistsException
- If the table already exists.Table createTable(NameIdentifier ident, Column[] columns, java.lang.String comment, java.util.Map<java.lang.String,java.lang.String> properties, Transform[] partitions, Distribution distribution, SortOrder[] sortOrders, Index[] indexes) throws NoSuchSchemaException, TableAlreadyExistsException
ident
- A table identifier.columns
- The columns of the new table.comment
- The table comment.properties
- The table properties.distribution
- The distribution of the tablesortOrders
- The sort orders of the tablepartitions
- The table partitioning.indexes
- The table indexes.NoSuchSchemaException
- If the schema does not exist.TableAlreadyExistsException
- If the table already exists.Table alterTable(NameIdentifier ident, TableChange... changes) throws NoSuchTableException, java.lang.IllegalArgumentException
change
to a table in the catalog.
Implementations may reject the change. If any change is rejected, no changes should be applied to the table.
ident
- A table identifier.changes
- Table changes to apply to the table.NoSuchTableException
- If the table does not exist.java.lang.IllegalArgumentException
- If the change is rejected by the implementation.boolean dropTable(NameIdentifier ident)
ident
- A table identifier.default boolean purgeTable(NameIdentifier ident) throws java.lang.UnsupportedOperationException
UnsupportedOperationException
is
thrown.
If the catalog supports to purge a table, this method should be overridden. The default
implementation throws an UnsupportedOperationException
.
ident
- A table identifier.java.lang.UnsupportedOperationException
- If the catalog does not support to purge a table.