Class DatabricksSession
java.lang.Object
com.databricks.jdbc.api.impl.DatabricksSession
- All Implemented Interfaces:
IDatabricksSession
Implementation of
IDatabricksSession, which maintains an underlying session in SQL
Gateway.-
Constructor Summary
ConstructorsConstructorDescriptionDatabricksSession(IDatabricksConnectionContext connectionContext) Creates an instance of Databricks session for given connection contextDatabricksSession(IDatabricksConnectionContext connectionContext, IDatabricksClient testDatabricksClient) Constructor method to be used for mocking in a test case. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the session.voidReturns default catalog associated with the sessionReturns the client info propertiesReturns the compression algorithm used on results dataGet the warehouse associated with the session.getConfigValue(String name) Returns the associated connection context for the sessionGets the current catalog from the databaseReturns the client for connecting to Databricks serverReturns the metadata clientReturns default schema associated with the sessionReturns the session configsGet the unique session-Id associated with the session.booleanisOpen()Checks if session is open and valid.voidopen()Opens a new session.voidsetCatalog(String catalog) Sets the default catalogvoidsetClientInfoProperty(String name, String value) Sets the client info propertyvoidvoidSets the default schemavoidsetSessionConfig(String name, String value) Sets the session configtoString()Extracts session to a string
-
Constructor Details
-
DatabricksSession
public DatabricksSession(IDatabricksConnectionContext connectionContext) throws DatabricksSQLException Creates an instance of Databricks session for given connection context- Parameters:
connectionContext- underlying connection context- Throws:
DatabricksSQLException
-
DatabricksSession
public DatabricksSession(IDatabricksConnectionContext connectionContext, IDatabricksClient testDatabricksClient) Constructor method to be used for mocking in a test case.
-
-
Method Details
-
getSessionId
Description copied from interface:IDatabricksSessionGet the unique session-Id associated with the session.- Specified by:
getSessionIdin interfaceIDatabricksSession- Returns:
- session-Id
-
getSessionInfo
- Specified by:
getSessionInfoin interfaceIDatabricksSession
-
getComputeResource
Description copied from interface:IDatabricksSessionGet the warehouse associated with the session.- Specified by:
getComputeResourcein interfaceIDatabricksSession- Returns:
- warehouse-Id
-
getCompressionCodec
Description copied from interface:IDatabricksSessionReturns the compression algorithm used on results data- Specified by:
getCompressionCodecin interfaceIDatabricksSession
-
isOpen
public boolean isOpen()Description copied from interface:IDatabricksSessionChecks if session is open and valid.- Specified by:
isOpenin interfaceIDatabricksSession- Returns:
- true if session is open
-
open
Description copied from interface:IDatabricksSessionOpens a new session.- Specified by:
openin interfaceIDatabricksSession- Throws:
DatabricksSQLException
-
close
Description copied from interface:IDatabricksSessionCloses the session.- Specified by:
closein interfaceIDatabricksSession- Throws:
DatabricksSQLException
-
getDatabricksClient
Description copied from interface:IDatabricksSessionReturns the client for connecting to Databricks server- Specified by:
getDatabricksClientin interfaceIDatabricksSession
-
getDatabricksMetadataClient
Description copied from interface:IDatabricksSessionReturns the metadata client- Specified by:
getDatabricksMetadataClientin interfaceIDatabricksSession
-
getCatalog
Description copied from interface:IDatabricksSessionReturns default catalog associated with the session- Specified by:
getCatalogin interfaceIDatabricksSession
-
setCatalog
Description copied from interface:IDatabricksSessionSets the default catalog- Specified by:
setCatalogin interfaceIDatabricksSession
-
getSchema
Description copied from interface:IDatabricksSessionReturns default schema associated with the session- Specified by:
getSchemain interfaceIDatabricksSession
-
setSchema
Description copied from interface:IDatabricksSessionSets the default schema- Specified by:
setSchemain interfaceIDatabricksSession
-
toString
Description copied from interface:IDatabricksSessionExtracts session to a string- Specified by:
toStringin interfaceIDatabricksSession- Overrides:
toStringin classObject
-
getSessionConfigs
Description copied from interface:IDatabricksSessionReturns the session configs- Specified by:
getSessionConfigsin interfaceIDatabricksSession
-
setSessionConfig
Description copied from interface:IDatabricksSessionSets the session config- Specified by:
setSessionConfigin interfaceIDatabricksSession
-
getClientInfoProperties
Description copied from interface:IDatabricksSessionReturns the client info properties- Specified by:
getClientInfoPropertiesin interfaceIDatabricksSession
-
getConfigValue
- Specified by:
getConfigValuein interfaceIDatabricksSession
-
setClientInfoProperty
Description copied from interface:IDatabricksSessionSets the client info property- Specified by:
setClientInfoPropertyin interfaceIDatabricksSession
-
getConnectionContext
Description copied from interface:IDatabricksSessionReturns the associated connection context for the session- Specified by:
getConnectionContextin interfaceIDatabricksSession
-
getCurrentCatalog
Description copied from interface:IDatabricksSessionGets the current catalog from the database- Specified by:
getCurrentCatalogin interfaceIDatabricksSession- Throws:
DatabricksSQLException
-
setEmptyMetadataClient
public void setEmptyMetadataClient()- Specified by:
setEmptyMetadataClientin interfaceIDatabricksSession
-
forceClose
public void forceClose()- Specified by:
forceClosein interfaceIDatabricksSession
-