Skip to main content

spark_batch

Creates, updates, deletes, gets or lists a spark_batch resource.

Overview

Namespark_batch
TypeResource
Idazure.synapse_spark.spark_batch

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idinteger
namestring
appIdstring
appInfoobject
artifactIdstring
errorInfoarray
jobTypestring
livyInfoobjectSparkBatchJobState.
logarray
pluginInfoobjectSparkServicePlugin.
resultstring
schedulerInfoobjectSparkScheduler.
sparkPoolNamestring
statestring
submitterIdstring
submitterNamestring
tagsobject
workspaceNamestring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_spark_batch_jobselectbatch_id, livy_api_version, spark_pool_name, endpointdetailedGets a single spark batch job.
get_spark_batch_jobsselectlivy_api_version, spark_pool_name, endpointfrom, size, detailedList all spark batch jobs which are running under a particular spark pool.
create_spark_batch_jobinsertlivy_api_version, spark_pool_name, endpoint, name, filedetailedCreate new spark batch job.
cancel_spark_batch_jobdeletebatch_id, livy_api_version, spark_pool_name, endpointCancels a running spark batch job.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
batch_idintegerIdentifier for the batch job.
endpointstringThe service endpoint host (no scheme). (default: )
livy_api_versionstring
spark_pool_namestring
detailedbooleanOptional query param specifying whether detailed response is returned beyond plain livy.
fromintegerOptional param specifying which index the list should begin from.
sizeintegerOptional param specifying the size of the returned list. By default it is 20 and that is the maximum.

SELECT examples

Gets a single spark batch job.

SELECT
id,
name,
appId,
appInfo,
artifactId,
errorInfo,
jobType,
livyInfo,
log,
pluginInfo,
result,
schedulerInfo,
sparkPoolName,
state,
submitterId,
submitterName,
tags,
workspaceName
FROM azure.synapse_spark.spark_batch
WHERE batch_id = '{{ batch_id }}' -- required
AND livy_api_version = '{{ livy_api_version }}' -- required
AND spark_pool_name = '{{ spark_pool_name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND detailed = '{{ detailed }}'
;

INSERT examples

Create new spark batch job.

INSERT INTO azure.synapse_spark.spark_batch (
tags,
artifactId,
name,
file,
className,
args,
jars,
pyFiles,
files,
archives,
conf,
driverMemory,
driverCores,
executorMemory,
executorCores,
numExecutors,
livy_api_version,
spark_pool_name,
endpoint,
detailed
)
SELECT
'{{ tags }}',
'{{ artifactId }}',
'{{ name }}' /* required */,
'{{ file }}' /* required */,
'{{ className }}',
'{{ args }}',
'{{ jars }}',
'{{ pyFiles }}',
'{{ files }}',
'{{ archives }}',
'{{ conf }}',
'{{ driverMemory }}',
{{ driverCores }},
'{{ executorMemory }}',
{{ executorCores }},
{{ numExecutors }},
'{{ livy_api_version }}',
'{{ spark_pool_name }}',
'{{ endpoint }}',
'{{ detailed }}'
RETURNING
id,
name,
appId,
appInfo,
artifactId,
errorInfo,
jobType,
livyInfo,
log,
pluginInfo,
result,
schedulerInfo,
sparkPoolName,
state,
submitterId,
submitterName,
tags,
workspaceName
;

DELETE examples

Cancels a running spark batch job.

DELETE FROM azure.synapse_spark.spark_batch
WHERE batch_id = '{{ batch_id }}' --required
AND livy_api_version = '{{ livy_api_version }}' --required
AND spark_pool_name = '{{ spark_pool_name }}' --required
AND endpoint = '{{ endpoint }}' --required
;