Package com.databricks.jdbc.dbclient
Interface IDatabricksClient
-
- All Known Implementing Classes:
DatabricksSdkClient,DatabricksThriftServiceClient
public interface IDatabricksClientInterface for Databricks client which abstracts the integration with Databricks server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancelStatement(StatementId statementId)Cancels a statement in Databricks servervoidcloseStatement(StatementId 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(ImmutableSessionInfo sessionInfo)Deletes a session for given session-IdDatabricksResultSetexecuteStatement(String sql, IDatabricksComputeResource computeResource, Map<Integer,ImmutableSqlParameter> parameters, StatementType statementType, IDatabricksSession session, IDatabricksStatementInternal parentStatement)Executes a statement in Databricks serverDatabricksResultSetexecuteStatementAsync(String sql, IDatabricksComputeResource computeResource, Map<Integer,ImmutableSqlParameter> parameters, IDatabricksSession session, IDatabricksStatementInternal parentStatement)Executes a statement in Databricks server asynchronouslyIDatabricksConnectionContextgetConnectionContext()com.databricks.sdk.core.DatabricksConfiggetDatabricksConfig()Retrieves underlying DatabricksConfigTFetchResultsRespgetMoreResults(IDatabricksStatementInternal parentStatement)Collection<ExternalLink>getResultChunks(StatementId statementId, long chunkIndex)Fetches the chunk details for given chunk index and statement-Id.DatabricksResultSetgetStatementResult(StatementId statementId, IDatabricksSession session, IDatabricksStatementInternal parentStatement)Fetches result for underlying statement-IdvoidresetAccessToken(String newAccessToken)Update the access token based on new value provided by the customer
-
-
-
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(ImmutableSessionInfo sessionInfo) throws DatabricksSQLException
Deletes a session for given session-Id- Parameters:
sessionInfo- for which the session should be deleted- Throws:
DatabricksSQLException
-
executeStatement
DatabricksResultSet executeStatement(String sql, IDatabricksComputeResource computeResource, Map<Integer,ImmutableSqlParameter> parameters, StatementType statementType, IDatabricksSession session, IDatabricksStatementInternal 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
-
executeStatementAsync
DatabricksResultSet executeStatementAsync(String sql, IDatabricksComputeResource computeResource, Map<Integer,ImmutableSqlParameter> parameters, IDatabricksSession session, IDatabricksStatementInternal parentStatement) throws SQLException
Executes a statement in Databricks server asynchronously- Parameters:
sql- SQL statement that needs to be executedcomputeResource- underlying SQL-warehouse or all-purpose clusterparameters- SQL parameters for the statementsession- underlying sessionparentStatement- statement instance if called from a statement- Returns:
- response for statement execution
- Throws:
SQLException
-
closeStatement
void closeStatement(StatementId statementId) throws DatabricksSQLException
Closes a statement in Databricks server- Parameters:
statementId- statement which should be closed- Throws:
DatabricksSQLException
-
cancelStatement
void cancelStatement(StatementId statementId) throws DatabricksSQLException
Cancels a statement in Databricks server- Parameters:
statementId- statement which should be aborted- Throws:
DatabricksSQLException
-
getStatementResult
DatabricksResultSet getStatementResult(StatementId statementId, IDatabricksSession session, IDatabricksStatementInternal parentStatement) throws SQLException
Fetches result for underlying statement-Id- Parameters:
statementId- statement which should be checked for statussession- underlying sessionparentStatement- statement instance- Throws:
SQLException
-
getResultChunks
Collection<ExternalLink> getResultChunks(StatementId 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()
-
resetAccessToken
void resetAccessToken(String newAccessToken)
Update the access token based on new value provided by the customer- Parameters:
newAccessToken- new access token value
-
getMoreResults
TFetchResultsResp getMoreResults(IDatabricksStatementInternal parentStatement) throws DatabricksSQLException
- Throws:
DatabricksSQLException
-
getDatabricksConfig
com.databricks.sdk.core.DatabricksConfig getDatabricksConfig()
Retrieves underlying DatabricksConfig
-
-