Package com.databricks.jdbc.client

## Interface DatabricksClient

All Known Implementing Classes:
  `DatabricksSdkClient`, `DatabricksThriftServiceClient`

    public interface DatabricksClient

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `cancelStatement​(String statementId)` Cancels a statement in Databricks server
`void` `closeStatement​(String statementId)` Closes a statement in Databricks server
`ImmutableSessionInfo` `createSession​(ComputeResource computeResource, String catalog, String schema, Map<String,​String> sessionConf)` Creates a new session for given warehouse-Id, catalog and session.
`void` `deleteSession​(IDatabricksSession session, ComputeResource computeResource)` Deletes a session for given session-Id
`DatabricksResultSet` `executeStatement​(String sql, ComputeResource computeResource, Map<Integer,​ImmutableSqlParameter> parameters, StatementType statementType, IDatabricksSession session, IDatabricksStatement parentStatement)` Executes a statement in Databricks server
`IDatabricksConnectionContext` `getConnectionContext()`
`Collection<ExternalLink>` `getResultChunks​(String statementId, long chunkIndex)` Fetches the chunk details for given chunk index and statement-Id.

### Method Detail

#### createSession

    ImmutableSessionInfo createSession​(ComputeResource 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 cluster
  `catalog` - for the session
  `schema` - for the session
  `sessionConf` - session configuration
Returns:
  created session
Throws:
  `DatabricksSQLException`

#### deleteSession

    void deleteSession​(IDatabricksSession session,
                       ComputeResource computeResource)
                throws DatabricksSQLException

Deletes a session for given session-Id

Parameters:
  `session` - for which the session should be deleted
  `computeResource` - underlying SQL-warehouse or all-purpose cluster
Throws:
  `DatabricksSQLException`

#### executeStatement

    DatabricksResultSet executeStatement​(String sql,
                                         ComputeResource 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 executed
  `computeResource` - underlying SQL-warehouse or all-purpose cluster
  `parameters` - SQL parameters for the statement
  `statementType` - type of statement (metadata, update or generic SQL)
  `session` - underlying session
  `parentStatement` - 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 fetched
  `chunkIndex` - chunkIndex for which chunk should be fetched
Throws:
  `DatabricksSQLException`

#### getConnectionContext

    IDatabricksConnectionContext getConnectionContext()