public interface Catalog extends AutoCloseable
| 限定符和类型 | 方法和说明 |
|---|---|
default List<CatalogTable> |
buildCatalogTablesWithErrorCheck(Iterator<TablePath> tablePaths) |
default <T> void |
buildColumnsWithErrorCheck(TablePath tablePath,
TableSchema.Builder builder,
Iterator<T> keys,
java.util.function.Function<T,Column> getColumn) |
void |
close()
Close the catalog when it is no longer needed and release any resource that it might be
holding.
|
void |
createDatabase(TablePath tablePath,
boolean ignoreIfExists) |
void |
createTable(TablePath tablePath,
CatalogTable table,
boolean ignoreIfExists)
Create a new table in this catalog.
|
boolean |
databaseExists(String databaseName)
Check if a database exists in this catalog.
|
void |
dropDatabase(TablePath tablePath,
boolean ignoreIfNotExists) |
void |
dropTable(TablePath tablePath,
boolean ignoreIfNotExists)
Drop an existing table in this catalog.
|
default void |
executeSql(TablePath tablePath,
String sql) |
String |
getDefaultDatabase()
Get the name of the default database for this catalog.
|
default Optional<Factory> |
getFactory() |
CatalogTable |
getTable(TablePath tablePath)
Return a
CatalogTable identified by the given TablePath. |
default List<CatalogTable> |
getTables(ReadonlyConfig config) |
default boolean |
isExistsData(TablePath tablePath) |
List<String> |
listDatabases()
Get the names of all databases in this catalog.
|
List<String> |
listTables(String databaseName)
Get names of all tables under this database.
|
String |
name()
Get the name of the catalog.
|
void |
open()
Open the catalog.
|
boolean |
tableExists(TablePath tablePath)
Check if a table exist in this catalog.
|
default void |
truncateTable(TablePath tablePath,
boolean ignoreIfNotExists)
Truncate an existing table data in this catalog.
|
void open() throws CatalogException
CatalogException - in case of any runtime exceptionvoid close()
throws CatalogException
close 在接口中 AutoCloseableCatalogException - in case of any runtime exceptionString name()
String getDefaultDatabase() throws CatalogException
CatalogException - in case of any runtime exceptionboolean databaseExists(String databaseName) throws CatalogException
databaseName - Name of the databaseCatalogException - in case of any runtime exceptionList<String> listDatabases() throws CatalogException
CatalogException - in case of any runtime exceptionList<String> listTables(String databaseName) throws CatalogException, DatabaseNotExistException
CatalogException - in case of any runtime exceptionDatabaseNotExistExceptionboolean tableExists(TablePath tablePath) throws CatalogException
tablePath - Path of the tableCatalogException - in case of any runtime exceptionCatalogTable getTable(TablePath tablePath) throws CatalogException, TableNotExistException
CatalogTable identified by the given TablePath. The framework will
resolve the metadata objects when necessary.tablePath - Path of the tableCatalogException - in case of any runtime exceptionTableNotExistExceptiondefault List<CatalogTable> getTables(ReadonlyConfig config) throws CatalogException
CatalogExceptiondefault List<CatalogTable> buildCatalogTablesWithErrorCheck(Iterator<TablePath> tablePaths)
default <T> void buildColumnsWithErrorCheck(TablePath tablePath, TableSchema.Builder builder, Iterator<T> keys, java.util.function.Function<T,Column> getColumn)
void createTable(TablePath tablePath, CatalogTable table, boolean ignoreIfExists) throws TableAlreadyExistException, DatabaseNotExistException, CatalogException
tablePath - Path of the tabletable - The table definitionignoreIfExists - Flag to specify behavior when a table with the given name already existTableAlreadyExistException - thrown if the table already exists in the catalog and
ignoreIfExists is falseDatabaseNotExistException - thrown if the database in tablePath doesn't exist in the
catalogCatalogException - in case of any runtime exceptionvoid dropTable(TablePath tablePath, boolean ignoreIfNotExists) throws TableNotExistException, CatalogException
tablePath - Path of the tableignoreIfNotExists - Flag to specify behavior when a table with the given name doesn't
existTableNotExistException - thrown if the table doesn't exist in the catalog and
ignoreIfNotExists is falseCatalogException - in case of any runtime exceptionvoid createDatabase(TablePath tablePath, boolean ignoreIfExists) throws DatabaseAlreadyExistException, CatalogException
void dropDatabase(TablePath tablePath, boolean ignoreIfNotExists) throws DatabaseNotExistException, CatalogException
default void truncateTable(TablePath tablePath, boolean ignoreIfNotExists) throws TableNotExistException, CatalogException
tablePath - Path of the tableignoreIfNotExists - Flag to specify behavior when a table with the given name doesn't
existTableNotExistException - thrown if the table doesn't exist in the catalog and
ignoreIfNotExists is falseCatalogException - in case of any runtime exceptiondefault boolean isExistsData(TablePath tablePath)
Copyright © 2024 The Apache Software Foundation. All rights reserved.