Class DatabricksSdkClient
- java.lang.Object
-
- com.databricks.jdbc.client.impl.sdk.DatabricksSdkClient
-
- All Implemented Interfaces:
DatabricksClient
public class DatabricksSdkClient extends Object implements DatabricksClient
Implementation of DatabricksClient interface using Databricks Java SDK.
-
-
Constructor Summary
Constructors Constructor Description DatabricksSdkClient(IDatabricksConnectionContext connectionContext)DatabricksSdkClient(IDatabricksConnectionContext connectionContext, com.databricks.sdk.service.sql.StatementExecutionService statementExecutionService, com.databricks.sdk.core.ApiClient apiClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelStatement(String statementId)Cancels a statement in Databricks servervoidcloseStatement(String statementId)Closes a statement in Databricks serverImmutableSessionInfocreateSession(ComputeResource warehouse, String catalog, String schema, Map<String,String> sessionConf)Creates a new session for given warehouse-Id, catalog and session.voiddeleteSession(IDatabricksSession session, ComputeResource warehouse)Deletes a session for given session-IdDatabricksResultSetexecuteStatement(String sql, ComputeResource computeResource, Map<Integer,ImmutableSqlParameter> parameters, StatementType statementType, IDatabricksSession session, IDatabricksStatement parentStatement)Executes a statement in Databricks serverCollection<ExternalLink>getResultChunks(String statementId, long chunkIndex)Fetches the chunk details for given chunk index and statement-Id.
-
-
-
Constructor Detail
-
DatabricksSdkClient
public DatabricksSdkClient(IDatabricksConnectionContext connectionContext) throws DatabricksParsingException
- Throws:
DatabricksParsingException
-
DatabricksSdkClient
public DatabricksSdkClient(IDatabricksConnectionContext connectionContext, com.databricks.sdk.service.sql.StatementExecutionService statementExecutionService, com.databricks.sdk.core.ApiClient apiClient) throws DatabricksParsingException
- Throws:
DatabricksParsingException
-
-
Method Detail
-
createSession
public ImmutableSessionInfo createSession(ComputeResource warehouse, String catalog, String schema, Map<String,String> sessionConf)
Description copied from interface:DatabricksClientCreates a new session for given warehouse-Id, catalog and session.- Specified by:
createSessionin interfaceDatabricksClient- Parameters:
warehouse- underlying SQL-warehouse or all-purpose clustercatalog- for the sessionschema- for the sessionsessionConf- session configuration- Returns:
- created session
-
deleteSession
public void deleteSession(IDatabricksSession session, ComputeResource warehouse) throws DatabricksSQLException
Description copied from interface:DatabricksClientDeletes a session for given session-Id- Specified by:
deleteSessionin interfaceDatabricksClient- Parameters:
session- for which the session should be deletedwarehouse- underlying SQL-warehouse or all-purpose cluster- Throws:
DatabricksSQLException
-
executeStatement
public DatabricksResultSet executeStatement(String sql, ComputeResource computeResource, Map<Integer,ImmutableSqlParameter> parameters, StatementType statementType, IDatabricksSession session, IDatabricksStatement parentStatement) throws SQLException
Description copied from interface:DatabricksClientExecutes a statement in Databricks server- Specified by:
executeStatementin interfaceDatabricksClient- 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
public void closeStatement(String statementId)
Description copied from interface:DatabricksClientCloses a statement in Databricks server- Specified by:
closeStatementin interfaceDatabricksClient- Parameters:
statementId- statement which should be closed
-
cancelStatement
public void cancelStatement(String statementId)
Description copied from interface:DatabricksClientCancels a statement in Databricks server- Specified by:
cancelStatementin interfaceDatabricksClient- Parameters:
statementId- statement which should be aborted
-
getResultChunks
public Collection<ExternalLink> getResultChunks(String statementId, long chunkIndex)
Description copied from interface:DatabricksClientFetches the chunk details for given chunk index and statement-Id.- Specified by:
getResultChunksin interfaceDatabricksClient- Parameters:
statementId- statement-Id for which chunk should be fetchedchunkIndex- chunkIndex for which chunk should be fetched
-
-