Share via


SparkSession class

Class representing a SparkSession.

Constructors

SparkSession(SynapseClientContext)

Create a SparkSession.

Methods

create(string, string, ExtendedLivySessionRequest, ServiceCallback<ExtendedLivySessionResponse>)
create(string, string, ExtendedLivySessionRequest, SparkSessionCreateOptionalParams)

Create new spark session.

create(string, string, ExtendedLivySessionRequest, SparkSessionCreateOptionalParams, ServiceCallback<ExtendedLivySessionResponse>)
createStatement(string, string, number, LivyStatementRequestBody, RequestOptionsBase)

Create statement within a spark session.

createStatement(string, string, number, LivyStatementRequestBody, RequestOptionsBase, ServiceCallback<LivyStatementResponseBody>)
createStatement(string, string, number, LivyStatementRequestBody, ServiceCallback<LivyStatementResponseBody>)
deleteMethod(string, string, number, RequestOptionsBase)

Cancels a running spark session.

deleteMethod(string, string, number, RequestOptionsBase, ServiceCallback<void>)
deleteMethod(string, string, number, ServiceCallback<void>)
deleteStatement(string, string, number, number, RequestOptionsBase)

Kill a statement within a session.

deleteStatement(string, string, number, number, RequestOptionsBase, ServiceCallback<LivyStatementCancellationResponse>)
deleteStatement(string, string, number, number, ServiceCallback<LivyStatementCancellationResponse>)
get(string, string, number, ServiceCallback<ExtendedLivySessionResponse>)
get(string, string, number, SparkSessionGetOptionalParams)

Gets a single spark session.

get(string, string, number, SparkSessionGetOptionalParams, ServiceCallback<ExtendedLivySessionResponse>)
getStatement(string, string, number, number, RequestOptionsBase)

Gets a single statement within a spark session.

getStatement(string, string, number, number, RequestOptionsBase, ServiceCallback<LivyStatementResponseBody>)
getStatement(string, string, number, number, ServiceCallback<LivyStatementResponseBody>)
list(string, string, ServiceCallback<ExtendedLivyListSessionResponse>)
list(string, string, SparkSessionListOptionalParams)

List all spark sessions which are running under a particular spark pool.

list(string, string, SparkSessionListOptionalParams, ServiceCallback<ExtendedLivyListSessionResponse>)
listStatements(string, string, number, RequestOptionsBase)

Gets a list of statements within a spark session.

listStatements(string, string, number, RequestOptionsBase, ServiceCallback<LivyStatementsResponseBody>)
listStatements(string, string, number, ServiceCallback<LivyStatementsResponseBody>)
resetTimeout(string, string, number, RequestOptionsBase)

Sends a keep alive call to the current session to reset the session timeout.

resetTimeout(string, string, number, RequestOptionsBase, ServiceCallback<void>)
resetTimeout(string, string, number, ServiceCallback<void>)

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.

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<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

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<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

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.

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<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

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.

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.

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<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

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<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

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.

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.

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<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

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<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

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.

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