Package org.apache.flink.table.catalog
Interface CatalogRegistry
-
- All Known Implementing Classes:
CatalogManager
@PublicEvolving public interface CatalogRegistry
A catalog registry for dealing with catalogs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<ResolvedCatalogBaseTable<?>>
getCatalogBaseTable(ObjectIdentifier objectIdentifier)
Retrieves a fully qualified table.Catalog
getCatalogOrError(String catalogName)
Gets a catalog by name.String
getCurrentCatalog()
Gets the name of the current catalog.String
getCurrentDatabase()
Get the name of the current database.Optional<CatalogPartition>
getPartition(ObjectIdentifier tableIdentifier, CatalogPartitionSpec partitionSpec)
Retrieves a partition with a fully qualified table path and partition spec.boolean
isTemporaryTable(ObjectIdentifier objectIdentifier)
Return whether the table with a fully qualified table path is temporary or not.ObjectIdentifier
qualifyIdentifier(UnresolvedIdentifier identifier)
Returns the full name of the given table path, this name may be padded with current catalog/database name based on theidentifier's
length.
-
-
-
Method Detail
-
getCurrentDatabase
String getCurrentDatabase()
Get the name of the current database.
-
getCurrentCatalog
String getCurrentCatalog()
Gets the name of the current catalog.
-
qualifyIdentifier
ObjectIdentifier qualifyIdentifier(UnresolvedIdentifier identifier)
Returns the full name of the given table path, this name may be padded with current catalog/database name based on theidentifier's
length.- Parameters:
identifier
- an unresolved identifier- Returns:
- a fully qualified object identifier
-
getCatalogOrError
Catalog getCatalogOrError(String catalogName) throws CatalogNotExistException
Gets a catalog by name.- Parameters:
catalogName
- name of the catalog to retrieve- Returns:
- the requested catalog
- Throws:
CatalogNotExistException
- if the catalog does not exist
-
getCatalogBaseTable
Optional<ResolvedCatalogBaseTable<?>> getCatalogBaseTable(ObjectIdentifier objectIdentifier)
Retrieves a fully qualified table. If the path is not yet fully qualified usequalifyIdentifier(UnresolvedIdentifier)
first.- Parameters:
objectIdentifier
- full path of the table to retrieve- Returns:
- resolved table that the path points to or empty if it does not exist.
-
isTemporaryTable
boolean isTemporaryTable(ObjectIdentifier objectIdentifier)
Return whether the table with a fully qualified table path is temporary or not.- Parameters:
objectIdentifier
- full path of the table- Returns:
- the table is temporary or not.
-
getPartition
Optional<CatalogPartition> getPartition(ObjectIdentifier tableIdentifier, CatalogPartitionSpec partitionSpec)
Retrieves a partition with a fully qualified table path and partition spec.- Parameters:
tableIdentifier
- full path of the table to retrievepartitionSpec
- full partition spec- Returns:
- partition in the table.
-
-