SparkSession class
Class representing a SparkSession.
Constructors
| Spark |
Create a SparkSession. |
Methods
Constructor Details
SparkSession(SynapseClientContext)
Create a SparkSession.
new SparkSession(client: SynapseClientContext)
Parameters
- client
- SynapseClientContext
Reference to the service client.
Method Details
create(string, string, ExtendedLivySessionRequest, ServiceCallback<ExtendedLivySessionResponse>)
function create(workspaceName: string, sparkPoolName: string, livyRequest: ExtendedLivySessionRequest, callback: ServiceCallback<ExtendedLivySessionResponse>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- livyRequest
- ExtendedLivySessionRequest
Livy compatible batch job request payload.
- callback
The callback
create(string, string, ExtendedLivySessionRequest, SparkSessionCreateOptionalParams)
Create new spark session.
function create(workspaceName: string, sparkPoolName: string, livyRequest: ExtendedLivySessionRequest, options?: SparkSessionCreateOptionalParams): Promise<SparkSessionCreateResponse>
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- livyRequest
- ExtendedLivySessionRequest
Livy compatible batch job request payload.
- options
- SparkSessionCreateOptionalParams
The optional parameters
Returns
Promise<SparkSessionCreateResponse>
Promise<Models.SparkSessionCreateResponse>
create(string, string, ExtendedLivySessionRequest, SparkSessionCreateOptionalParams, ServiceCallback<ExtendedLivySessionResponse>)
function create(workspaceName: string, sparkPoolName: string, livyRequest: ExtendedLivySessionRequest, options: SparkSessionCreateOptionalParams, callback: ServiceCallback<ExtendedLivySessionResponse>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- livyRequest
- ExtendedLivySessionRequest
Livy compatible batch job request payload.
- options
- SparkSessionCreateOptionalParams
The optional parameters
- callback
The callback
createStatement(string, string, number, LivyStatementRequestBody, RequestOptionsBase)
Create statement within a spark session.
function createStatement(workspaceName: string, sparkPoolName: string, sessionId: number, livyRequest: LivyStatementRequestBody, options?: RequestOptionsBase): Promise<SparkSessionCreateStatementResponse>
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- livyRequest
- LivyStatementRequestBody
Livy compatible batch job request payload.
- options
- RequestOptionsBase
The optional parameters
Returns
Promise<SparkSessionCreateStatementResponse>
Promise<Models.SparkSessionCreateStatementResponse>
createStatement(string, string, number, LivyStatementRequestBody, RequestOptionsBase, ServiceCallback<LivyStatementResponseBody>)
function createStatement(workspaceName: string, sparkPoolName: string, sessionId: number, livyRequest: LivyStatementRequestBody, options: RequestOptionsBase, callback: ServiceCallback<LivyStatementResponseBody>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- livyRequest
- LivyStatementRequestBody
Livy compatible batch job request payload.
- options
- RequestOptionsBase
The optional parameters
- callback
The callback
createStatement(string, string, number, LivyStatementRequestBody, ServiceCallback<LivyStatementResponseBody>)
function createStatement(workspaceName: string, sparkPoolName: string, sessionId: number, livyRequest: LivyStatementRequestBody, callback: ServiceCallback<LivyStatementResponseBody>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- livyRequest
- LivyStatementRequestBody
Livy compatible batch job request payload.
- callback
The callback
deleteMethod(string, string, number, RequestOptionsBase)
Cancels a running spark session.
function deleteMethod(workspaceName: string, sparkPoolName: string, sessionId: number, options?: RequestOptionsBase): Promise<RestResponse>
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- options
- RequestOptionsBase
The optional parameters
Returns
Promise<RestResponse>
Promise<msRest.RestResponse>
deleteMethod(string, string, number, RequestOptionsBase, ServiceCallback<void>)
function deleteMethod(workspaceName: string, sparkPoolName: string, sessionId: number, options: RequestOptionsBase, callback: ServiceCallback<void>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- options
- RequestOptionsBase
The optional parameters
- callback
-
ServiceCallback<void>
The callback
deleteMethod(string, string, number, ServiceCallback<void>)
function deleteMethod(workspaceName: string, sparkPoolName: string, sessionId: number, callback: ServiceCallback<void>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- callback
-
ServiceCallback<void>
The callback
deleteStatement(string, string, number, number, RequestOptionsBase)
Kill a statement within a session.
function deleteStatement(workspaceName: string, sparkPoolName: string, sessionId: number, statementId: number, options?: RequestOptionsBase): Promise<SparkSessionDeleteStatementResponse>
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- statementId
-
number
Identifier for the statement.
- options
- RequestOptionsBase
The optional parameters
Returns
Promise<SparkSessionDeleteStatementResponse>
Promise<Models.SparkSessionDeleteStatementResponse>
deleteStatement(string, string, number, number, RequestOptionsBase, ServiceCallback<LivyStatementCancellationResponse>)
function deleteStatement(workspaceName: string, sparkPoolName: string, sessionId: number, statementId: number, options: RequestOptionsBase, callback: ServiceCallback<LivyStatementCancellationResponse>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- statementId
-
number
Identifier for the statement.
- options
- RequestOptionsBase
The optional parameters
The callback
deleteStatement(string, string, number, number, ServiceCallback<LivyStatementCancellationResponse>)
function deleteStatement(workspaceName: string, sparkPoolName: string, sessionId: number, statementId: number, callback: ServiceCallback<LivyStatementCancellationResponse>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- statementId
-
number
Identifier for the statement.
The callback
get(string, string, number, ServiceCallback<ExtendedLivySessionResponse>)
function get(workspaceName: string, sparkPoolName: string, sessionId: number, callback: ServiceCallback<ExtendedLivySessionResponse>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- callback
The callback
get(string, string, number, SparkSessionGetOptionalParams)
Gets a single spark session.
function get(workspaceName: string, sparkPoolName: string, sessionId: number, options?: SparkSessionGetOptionalParams): Promise<SparkSessionGetResponse>
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- options
- SparkSessionGetOptionalParams
The optional parameters
Returns
Promise<SparkSessionGetResponse>
Promise<Models.SparkSessionGetResponse>
get(string, string, number, SparkSessionGetOptionalParams, ServiceCallback<ExtendedLivySessionResponse>)
function get(workspaceName: string, sparkPoolName: string, sessionId: number, options: SparkSessionGetOptionalParams, callback: ServiceCallback<ExtendedLivySessionResponse>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- options
- SparkSessionGetOptionalParams
The optional parameters
- callback
The callback
getStatement(string, string, number, number, RequestOptionsBase)
Gets a single statement within a spark session.
function getStatement(workspaceName: string, sparkPoolName: string, sessionId: number, statementId: number, options?: RequestOptionsBase): Promise<SparkSessionGetStatementResponse>
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- statementId
-
number
Identifier for the statement.
- options
- RequestOptionsBase
The optional parameters
Returns
Promise<SparkSessionGetStatementResponse>
Promise<Models.SparkSessionGetStatementResponse>
getStatement(string, string, number, number, RequestOptionsBase, ServiceCallback<LivyStatementResponseBody>)
function getStatement(workspaceName: string, sparkPoolName: string, sessionId: number, statementId: number, options: RequestOptionsBase, callback: ServiceCallback<LivyStatementResponseBody>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- statementId
-
number
Identifier for the statement.
- options
- RequestOptionsBase
The optional parameters
- callback
The callback
getStatement(string, string, number, number, ServiceCallback<LivyStatementResponseBody>)
function getStatement(workspaceName: string, sparkPoolName: string, sessionId: number, statementId: number, callback: ServiceCallback<LivyStatementResponseBody>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- statementId
-
number
Identifier for the statement.
- callback
The callback
list(string, string, ServiceCallback<ExtendedLivyListSessionResponse>)
function list(workspaceName: string, sparkPoolName: string, callback: ServiceCallback<ExtendedLivyListSessionResponse>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
The callback
list(string, string, SparkSessionListOptionalParams)
List all spark sessions which are running under a particular spark pool.
function list(workspaceName: string, sparkPoolName: string, options?: SparkSessionListOptionalParams): Promise<SparkSessionListResponse>
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- options
- SparkSessionListOptionalParams
The optional parameters
Returns
Promise<SparkSessionListResponse>
Promise<Models.SparkSessionListResponse>
list(string, string, SparkSessionListOptionalParams, ServiceCallback<ExtendedLivyListSessionResponse>)
function list(workspaceName: string, sparkPoolName: string, options: SparkSessionListOptionalParams, callback: ServiceCallback<ExtendedLivyListSessionResponse>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- options
- SparkSessionListOptionalParams
The optional parameters
The callback
listStatements(string, string, number, RequestOptionsBase)
Gets a list of statements within a spark session.
function listStatements(workspaceName: string, sparkPoolName: string, sessionId: number, options?: RequestOptionsBase): Promise<SparkSessionListStatementsResponse>
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- options
- RequestOptionsBase
The optional parameters
Returns
Promise<SparkSessionListStatementsResponse>
Promise<Models.SparkSessionListStatementsResponse>
listStatements(string, string, number, RequestOptionsBase, ServiceCallback<LivyStatementsResponseBody>)
function listStatements(workspaceName: string, sparkPoolName: string, sessionId: number, options: RequestOptionsBase, callback: ServiceCallback<LivyStatementsResponseBody>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- options
- RequestOptionsBase
The optional parameters
- callback
The callback
listStatements(string, string, number, ServiceCallback<LivyStatementsResponseBody>)
function listStatements(workspaceName: string, sparkPoolName: string, sessionId: number, callback: ServiceCallback<LivyStatementsResponseBody>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- callback
The callback
resetTimeout(string, string, number, RequestOptionsBase)
Sends a keep alive call to the current session to reset the session timeout.
function resetTimeout(workspaceName: string, sparkPoolName: string, sessionId: number, options?: RequestOptionsBase): Promise<RestResponse>
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- options
- RequestOptionsBase
The optional parameters
Returns
Promise<RestResponse>
Promise<msRest.RestResponse>
resetTimeout(string, string, number, RequestOptionsBase, ServiceCallback<void>)
function resetTimeout(workspaceName: string, sparkPoolName: string, sessionId: number, options: RequestOptionsBase, callback: ServiceCallback<void>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- options
- RequestOptionsBase
The optional parameters
- callback
-
ServiceCallback<void>
The callback
resetTimeout(string, string, number, ServiceCallback<void>)
function resetTimeout(workspaceName: string, sparkPoolName: string, sessionId: number, callback: ServiceCallback<void>)
Parameters
- workspaceName
-
string
The name of the workspace to execute operations on.
- sparkPoolName
-
string
Name of the spark pool. "ondemand" targets the ondemand pool.
- sessionId
-
number
Identifier for the session.
- callback
-
ServiceCallback<void>
The callback