Skip to main content

batches

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

Overview​

Namebatches
TypeResource
Idgoogle.dataproc.batches

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. The resource name of the batch.
createTimestring (google-datetime)Output only. The time when the batch was created.
creatorstringOutput only. The email address of the user who created the batch.
environmentConfigobjectOptional. Environment configuration for the batch execution. (id: EnvironmentConfig)
labelsobjectOptional. The labels to associate with this batch. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a batch.
operationstringOutput only. The resource name of the operation associated with this batch.
pysparkBatchobjectOptional. PySpark batch config. (id: PySparkBatch)
pysparkNotebookBatchobjectOptional. PySpark notebook batch config. (id: PySparkNotebookBatch)
runtimeConfigobjectOptional. Runtime configuration for the batch execution. (id: RuntimeConfig)
runtimeInfoobjectOutput only. Runtime information about batch execution. (id: RuntimeInfo)
sparkBatchobjectOptional. Spark batch config. (id: SparkBatch)
sparkRBatchobjectOptional. SparkR batch config. (id: SparkRBatch)
sparkSqlBatchobjectOptional. SparkSql batch config. (id: SparkSqlBatch)
statestringOutput only. The state of the batch. (STATE_UNSPECIFIED, PENDING, RUNNING, CANCELLING, CANCELLED, SUCCEEDED, FAILED)
stateHistoryarrayOutput only. Historical state information for the batch.
stateMessagestringOutput only. Batch state details, such as a failure description if the state is FAILED.
stateTimestring (google-datetime)Output only. The time when the batch entered a current state.
uuidstringOutput only. A batch UUID (Unique Universal Identifier). The service generates this value when it creates the batch.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_batches_getselectprojectsId, locationsId, batchesIdGets the batch workload resource representation.
projects_locations_batches_listselectprojectsId, locationsIdfilter, orderBy, pageSize, pageTokenLists batch workloads.
projects_locations_batches_createinsertprojectsId, locationsIdbatchId, requestIdCreates a batch workload that executes asynchronously.
projects_locations_batches_deletedeleteprojectsId, locationsId, batchesIdDeletes the batch workload resource. If the batch is not in a CANCELLED, SUCCEEDED or FAILED State, the delete operation fails and the response returns FAILED_PRECONDITION.
projects_locations_batches_analyzeexecprojectsId, locationsId, batchesIdAnalyze a Batch for possible recommendations and insights.

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
batchesIdstring
locationsIdstring
projectsIdstring
batchIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring

SELECT examples​

Gets the batch workload resource representation.

SELECT
name,
createTime,
creator,
environmentConfig,
labels,
operation,
pysparkBatch,
pysparkNotebookBatch,
runtimeConfig,
runtimeInfo,
sparkBatch,
sparkRBatch,
sparkSqlBatch,
state,
stateHistory,
stateMessage,
stateTime,
uuid
FROM google.dataproc.batches
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND batchesId = '{{ batchesId }}' -- required
;

INSERT examples​

Creates a batch workload that executes asynchronously.

INSERT INTO google.dataproc.batches (
data__environmentConfig,
data__labels,
data__pysparkBatch,
data__pysparkNotebookBatch,
data__runtimeConfig,
data__sparkBatch,
data__sparkRBatch,
data__sparkSqlBatch,
projectsId,
locationsId,
batchId,
requestId
)
SELECT
'{{ environmentConfig }}',
'{{ labels }}',
'{{ pysparkBatch }}',
'{{ pysparkNotebookBatch }}',
'{{ runtimeConfig }}',
'{{ sparkBatch }}',
'{{ sparkRBatch }}',
'{{ sparkSqlBatch }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ batchId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples​

Deletes the batch workload resource. If the batch is not in a CANCELLED, SUCCEEDED or FAILED State, the delete operation fails and the response returns FAILED_PRECONDITION.

DELETE FROM google.dataproc.batches
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND batchesId = '{{ batchesId }}' --required
;

Lifecycle Methods​

Analyze a Batch for possible recommendations and insights.

EXEC google.dataproc.batches.projects_locations_batches_analyze
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@batchesId='{{ batchesId }}' --required
@@json=
'{
"requestId": "{{ requestId }}",
"requestorId": "{{ requestorId }}"
}'
;