Class DatabricksMetadataQueryClient
- java.lang.Object
-
- com.databricks.jdbc.dbclient.impl.sqlexec.DatabricksMetadataQueryClient
-
- All Implemented Interfaces:
IDatabricksMetadataClient
public class DatabricksMetadataQueryClient extends Object implements IDatabricksMetadataClient
Implementation forIDatabricksMetadataClientusingIDatabricksClient.
-
-
Constructor Summary
Constructors Constructor Description DatabricksMetadataQueryClient(IDatabricksClient queryExecutionClient)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IDatabricksConnectionContextgetConnectionContext()Returns the connection context this metadata client is bound to.static ExecutorServicegetOrCreateMetadataThreadPool()DatabricksResultSetlistCatalogs(IDatabricksSession session)Returns the list of catalogsDatabricksResultSetlistColumns(IDatabricksSession session, String catalog, String schemaNamePattern, String tableNamePattern, String columnNamePattern)Returns the list of columnsDatabricksResultSetlistCrossReferences(IDatabricksSession session, String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable)Returns the list of cross references between a parent table and a foreign tableDatabricksResultSetlistExportedKeys(IDatabricksSession session, String catalog, String schema, String table)Returns the list of imported keysDatabricksResultSetlistFunctions(IDatabricksSession session, String catalog, String schemaNamePattern, String functionNamePattern)Returns the list of functionsDatabricksResultSetlistImportedKeys(IDatabricksSession session, String catalog, String schema, String table)Returns the list of imported keysDatabricksResultSetlistPrimaryKeys(IDatabricksSession session, String catalog, String schema, String table)Returns the list of primary keysDatabricksResultSetlistProcedureColumns(IDatabricksSession session, String catalog, String schemaNamePattern, String procedureNamePattern, String columnNamePattern)Returns the list of stored procedure columns/parametersDatabricksResultSetlistProcedures(IDatabricksSession session, String catalog, String schemaNamePattern, String procedureNamePattern)Returns the list of stored proceduresDatabricksResultSetlistSchemas(IDatabricksSession session, String catalog, String schemaNamePattern)Returns the list of schemasDatabricksResultSetlistTables(IDatabricksSession session, String catalog, String schemaNamePattern, String tableNamePattern, String[] tableTypes)Returns the list of tablesDatabricksResultSetlistTableTypes(IDatabricksSession session)Returns list of table typesDatabricksResultSetlistTypeInfo(IDatabricksSession session)Returns information about types supported by Databricks server
-
-
-
Constructor Detail
-
DatabricksMetadataQueryClient
public DatabricksMetadataQueryClient(IDatabricksClient queryExecutionClient)
-
-
Method Detail
-
getConnectionContext
public IDatabricksConnectionContext getConnectionContext()
Description copied from interface:IDatabricksMetadataClientReturns the connection context this metadata client is bound to. Used so telemetry can be attributed to the owning connection rather than a shared thread-local (ES-1961329).- Specified by:
getConnectionContextin interfaceIDatabricksMetadataClient
-
listTypeInfo
public DatabricksResultSet listTypeInfo(IDatabricksSession session)
Description copied from interface:IDatabricksMetadataClientReturns information about types supported by Databricks server- Specified by:
listTypeInfoin interfaceIDatabricksMetadataClient
-
listCatalogs
public DatabricksResultSet listCatalogs(IDatabricksSession session) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of catalogs- Specified by:
listCatalogsin interfaceIDatabricksMetadataClient- Throws:
SQLException
-
listSchemas
public DatabricksResultSet listSchemas(IDatabricksSession session, String catalog, String schemaNamePattern) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of schemas- Specified by:
listSchemasin interfaceIDatabricksMetadataClient- Parameters:
session- underlying sessioncatalog- catalogName which must match to catalog in databaseschemaNamePattern- must match to schema name in database (can be a regex pattern or absolute name)- Returns:
- a DatabricksResultSet representing list of schemas
- Throws:
SQLException
-
listTables
public DatabricksResultSet listTables(IDatabricksSession session, String catalog, String schemaNamePattern, String tableNamePattern, String[] tableTypes) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of tables- Specified by:
listTablesin interfaceIDatabricksMetadataClient- Parameters:
session- underlying sessioncatalog- catalogName which must match to catalog in databaseschemaNamePattern- must match to schema name in database (can be a regex pattern or absolute name)tableNamePattern- must match to table name in database (can be a regex pattern or absolute name)- Returns:
- a DatabricksResultSet representing list of tables
- Throws:
SQLException
-
listTableTypes
public DatabricksResultSet listTableTypes(IDatabricksSession session) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns list of table types- Specified by:
listTableTypesin interfaceIDatabricksMetadataClient- Throws:
SQLException
-
listColumns
public DatabricksResultSet listColumns(IDatabricksSession session, String catalog, String schemaNamePattern, String tableNamePattern, String columnNamePattern) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of columns- Specified by:
listColumnsin interfaceIDatabricksMetadataClient- Parameters:
session- underlying sessioncatalog- catalogName which must match to catalog in databaseschemaNamePattern- must match to schema name in database (can be a regex pattern or absolute name)tableNamePattern- must match to table name in database (can be a regex pattern or absolute name)columnNamePattern- must match to column name in database (can be a regex pattern or absolute name)- Returns:
- a DatabricksResultSet representing list of columns
- Throws:
SQLException
-
listFunctions
public DatabricksResultSet listFunctions(IDatabricksSession session, String catalog, String schemaNamePattern, String functionNamePattern) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of functions- Specified by:
listFunctionsin interfaceIDatabricksMetadataClient- Parameters:
session- underlying sessioncatalog- catalogName which must match to catalog in databaseschemaNamePattern- must match to schema name in database (can be a regex pattern or absolute name)functionNamePattern- must match to function name in database (can be a regex pattern or absolute name)- Returns:
- a DatabricksResultSet representing list of functions
- Throws:
SQLException
-
listProcedures
public DatabricksResultSet listProcedures(IDatabricksSession session, String catalog, String schemaNamePattern, String procedureNamePattern) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of stored procedures- Specified by:
listProceduresin interfaceIDatabricksMetadataClient- Parameters:
session- underlying sessioncatalog- catalogName; null means use system catalogschemaNamePattern- schema name pattern (can be a LIKE pattern)procedureNamePattern- procedure name pattern (can be a LIKE pattern)- Returns:
- a DatabricksResultSet representing list of procedures
- Throws:
SQLException
-
listProcedureColumns
public DatabricksResultSet listProcedureColumns(IDatabricksSession session, String catalog, String schemaNamePattern, String procedureNamePattern, String columnNamePattern) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of stored procedure columns/parameters- Specified by:
listProcedureColumnsin interfaceIDatabricksMetadataClient- Parameters:
session- underlying sessioncatalog- catalogName; null means use system catalogschemaNamePattern- schema name pattern (can be a LIKE pattern)procedureNamePattern- procedure name pattern (can be a LIKE pattern)columnNamePattern- column/parameter name pattern (can be a LIKE pattern)- Returns:
- a DatabricksResultSet representing list of procedure columns
- Throws:
SQLException
-
listPrimaryKeys
public DatabricksResultSet listPrimaryKeys(IDatabricksSession session, String catalog, String schema, String table) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of primary keys- Specified by:
listPrimaryKeysin interfaceIDatabricksMetadataClient- Parameters:
session- underlying sessioncatalog- catalogName which must match to catalog in databaseschema- must match to a schema in databasetable- must match to a table in database- Returns:
- a DatabricksResultSet representing list of functions
- Throws:
SQLException
-
listImportedKeys
public DatabricksResultSet listImportedKeys(IDatabricksSession session, String catalog, String schema, String table) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of imported keys- Specified by:
listImportedKeysin interfaceIDatabricksMetadataClient- Parameters:
session- underlying sessioncatalog- catalogName which must match to catalog in databaseschema- must match to a schema in databasetable- must match to a table in database- Returns:
- a DatabricksResultSet representing list of imported keys
- Throws:
SQLException
-
listExportedKeys
public DatabricksResultSet listExportedKeys(IDatabricksSession session, String catalog, String schema, String table) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of imported keys- Specified by:
listExportedKeysin interfaceIDatabricksMetadataClient- Parameters:
session- underlying sessioncatalog- catalogName which must match to catalog in databaseschema- must match to a schema in databasetable- must match to a table in database- Returns:
- a DatabricksResultSet representing list of imported keys
- Throws:
SQLException
-
listCrossReferences
public DatabricksResultSet listCrossReferences(IDatabricksSession session, String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException
Description copied from interface:IDatabricksMetadataClientReturns the list of cross references between a parent table and a foreign table- Specified by:
listCrossReferencesin interfaceIDatabricksMetadataClient- Parameters:
session- underlying sessionparentCatalog- catalogName which must match to catalog in databaseparentSchema- must match to a schema in databaseparentTable- must match to a table in databaseforeignCatalog- catalogName which must match to foreign catalog in databaseforeignSchema- must match to a foreign schema in databaseforeignTable- must match to a foreign table in database- Returns:
- a DatabricksResultSet representing list of cross references
- Throws:
SQLException
-
getOrCreateMetadataThreadPool
public static ExecutorService getOrCreateMetadataThreadPool()
-
-