Package com.databricks.jdbc.dbclient
Interface DatabricksClient
-
- All Known Implementing Classes:
DatabricksSdkClient,DatabricksThriftServiceClient
public interface DatabricksClientInterface for Databricks client which abstracts the integration with Databricks server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancelStatement(String statementId)Cancels a statement in Databricks servervoidcloseStatement(String statementId)Closes a statement in Databricks serverImmutableSessionInfocreateSession(IDatabricksComputeResource computeResource, String catalog, String schema, Map<String,String> sessionConf)Creates a new session for given warehouse-Id, catalog and session.voiddeleteSession(IDatabricksSession session, IDatabricksComputeResource computeResource)Deletes a session for given session-IdDatabricksResultSetexecuteStatement(String sql, IDatabricksComputeResource computeResource, Map<Integer,ImmutableSqlParameter> parameters, StatementType statementType, IDatabricksSession session, IDatabricksStatement parentStatement)Executes a statement in Databricks serverIDatabricksConnectionContextgetConnectionContext()Collection<ExternalLink>getResultChunks(String statementId, long chunkIndex)Fetches the chunk details for given chunk index and statement-Id.
-
-
-
Method Detail
-
createSession
ImmutableSessionInfo createSession(IDatabricksComputeResource computeResource, String catalog, String schema, Map<String,String> sessionConf) throws DatabricksSQLException
Creates a new session for given warehouse-Id, catalog and session.- Parameters:
computeResource- underlying SQL-warehouse or all-purpose clustercatalog- for the sessionschema- for the sessionsessionConf- session configuration- Returns:
- created session
- Throws:
DatabricksSQLException
-
deleteSession
void deleteSession(IDatabricksSession session, IDatabricksComputeResource computeResource) throws DatabricksSQLException
Deletes a session for given session-Id- Parameters:
session- for which the session should be deletedcomputeResource- underlying SQL-warehouse or all-purpose cluster- Throws:
DatabricksSQLException
-
executeStatement
DatabricksResultSet executeStatement(String sql, IDatabricksComputeResource computeResource, Map<Integer,ImmutableSqlParameter> parameters, StatementType statementType, IDatabricksSession session, IDatabricksStatement parentStatement) throws SQLException
Executes a statement in Databricks server- Parameters:
sql- SQL statement that needs to be executedcomputeResource- underlying SQL-warehouse or all-purpose clusterparameters- SQL parameters for the statementstatementType- type of statement (metadata, update or generic SQL)session- underlying sessionparentStatement- statement instance if called from a statement- Returns:
- response for statement execution
- Throws:
SQLException
-
closeStatement
void closeStatement(String statementId) throws DatabricksSQLException
Closes a statement in Databricks server- Parameters:
statementId- statement which should be closed- Throws:
DatabricksSQLException
-
cancelStatement
void cancelStatement(String statementId) throws DatabricksSQLException
Cancels a statement in Databricks server- Parameters:
statementId- statement which should be aborted- Throws:
DatabricksSQLException
-
getResultChunks
Collection<ExternalLink> getResultChunks(String statementId, long chunkIndex) throws DatabricksSQLException
Fetches the chunk details for given chunk index and statement-Id.- Parameters:
statementId- statement-Id for which chunk should be fetchedchunkIndex- chunkIndex for which chunk should be fetched- Throws:
DatabricksSQLException
-
getConnectionContext
IDatabricksConnectionContext getConnectionContext()
-
-