@PublicEvolving public class JdbcCatalog extends AbstractJdbcCatalog
baseUrl, defaultUrl, pwd, userClassLoader, username
Constructor and Description |
---|
JdbcCatalog(ClassLoader userClassLoader,
String catalogName,
String defaultDatabase,
String username,
String pwd,
String baseUrl)
Creates a JdbcCatalog.
|
JdbcCatalog(String catalogName,
String defaultDatabase,
String username,
String pwd,
String baseUrl)
Deprecated.
please use
JdbcCatalog(ClassLoader, String, String, String,
String, String) instead. |
Modifier and Type | Method and Description |
---|---|
CatalogDatabase |
getDatabase(String databaseName)
Get a database from this catalog.
|
AbstractJdbcCatalog |
getInternal() |
CatalogBaseTable |
getTable(ObjectPath tablePath)
|
List<String> |
listDatabases()
Get the names of all databases in this catalog.
|
List<String> |
listTables(String databaseName)
Get names of all tables and views under this database.
|
boolean |
tableExists(ObjectPath tablePath)
Check if a table or view exists in this catalog.
|
alterDatabase, alterFunction, alterPartition, alterPartitionColumnStatistics, alterPartitionStatistics, alterTable, alterTableColumnStatistics, alterTableStatistics, close, createDatabase, createFunction, createPartition, createTable, databaseExists, dropDatabase, dropFunction, dropPartition, dropTable, extractColumnValuesBySQL, fromJDBCType, functionExists, getBaseUrl, getFactory, getFunction, getPartition, getPartitionColumnStatistics, getPartitionStatistics, getPassword, getPrimaryKey, getSchemaName, getSchemaTableName, getTableColumnStatistics, getTableName, getTableStatistics, getUsername, listFunctions, listPartitions, listPartitions, listPartitionsByFilter, listViews, open, partitionExists, renameTable
getDefaultDatabase, getName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
alterTable, bulkGetPartitionColumnStatistics, bulkGetPartitionStatistics, dropDatabase, getFunctionDefinitionFactory, getTableFactory, supportsManagedTable
public JdbcCatalog(String catalogName, String defaultDatabase, String username, String pwd, String baseUrl)
JdbcCatalog(ClassLoader, String, String, String,
String, String)
instead.public JdbcCatalog(ClassLoader userClassLoader, String catalogName, String defaultDatabase, String username, String pwd, String baseUrl)
userClassLoader
- the classloader used to load JDBC drivercatalogName
- the registered catalog namedefaultDatabase
- the default database nameusername
- the username used to connect the databasepwd
- the password used to connect the databasebaseUrl
- the base URL of the database, e.g. jdbc:mysql://localhost:3306public List<String> listDatabases() throws CatalogException
Catalog
CatalogException
- in case of any runtime exceptionpublic CatalogDatabase getDatabase(String databaseName) throws DatabaseNotExistException, CatalogException
Catalog
getDatabase
in interface Catalog
getDatabase
in class AbstractJdbcCatalog
databaseName
- Name of the databaseDatabaseNotExistException
- if the database does not existCatalogException
- in case of any runtime exceptionpublic List<String> listTables(String databaseName) throws DatabaseNotExistException, CatalogException
Catalog
DatabaseNotExistException
- if the database does not existCatalogException
- in case of any runtime exceptionpublic CatalogBaseTable getTable(ObjectPath tablePath) throws TableNotExistException, CatalogException
Catalog
CatalogTable
or CatalogView
identified by the given ObjectPath
. The framework will resolve the metadata objects when necessary.getTable
in interface Catalog
getTable
in class AbstractJdbcCatalog
tablePath
- Path of the table or viewTableNotExistException
- if the target does not existCatalogException
- in case of any runtime exceptionpublic boolean tableExists(ObjectPath tablePath) throws CatalogException
Catalog
tablePath
- Path of the table or viewCatalogException
- in case of any runtime exception@VisibleForTesting public AbstractJdbcCatalog getInternal()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.