Skip to main content

batches

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

Overview

Namebatches
TypeResource
Idgoogle.dataproc.batches

Fields

NameDatatypeDescription
namestringOutput only. The resource name of the batch.
createTimestringOutput only. The time when the batch was created.
creatorstringOutput only. The email address of the user who created the batch.
environmentConfigobjectEnvironment configuration for a workload.
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.
pysparkBatchobjectA configuration for running an Apache PySpark (https://spark.apache.org/docs/latest/api/python/getting_started/quickstart.html) batch workload.
runtimeConfigobjectRuntime configuration for a workload.
runtimeInfoobjectRuntime information about workload execution.
sparkBatchobjectA configuration for running an Apache Spark (https://spark.apache.org/) batch workload.
sparkRBatchobjectA configuration for running an Apache SparkR (https://spark.apache.org/docs/latest/sparkr.html) batch workload.
sparkSqlBatchobjectA configuration for running Apache Spark SQL (https://spark.apache.org/sql/) queries as a batch workload.
statestringOutput only. The state of the batch.
stateHistoryarrayOutput only. Historical state information for the batch.
stateMessagestringOutput only. Batch state details, such as a failure description if the state is FAILED.
stateTimestringOutput 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

NameAccessible byRequired ParamsDescription
projects_locations_batches_getSELECTbatchesId, locationsId, projectsIdGets the batch workload resource representation.
projects_locations_batches_listSELECTlocationsId, projectsIdLists batch workloads.
projects_locations_batches_createINSERTlocationsId, projectsIdCreates a batch workload that executes asynchronously.
projects_locations_batches_deleteDELETEbatchesId, locationsId, projectsIdDeletes 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_analyzeEXECbatchesId, locationsId, projectsIdAnalyze a Batch for possible recommendations and insights.

SELECT examples

Lists batch workloads.

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

INSERT example

Use the following StackQL query and manifest file to create a new batches resource.

/*+ create */
INSERT INTO google.dataproc.batches (
locationsId,
projectsId,
pysparkBatch,
sparkBatch,
sparkRBatch,
sparkSqlBatch,
labels,
runtimeConfig,
environmentConfig
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ pysparkBatch }}',
'{{ sparkBatch }}',
'{{ sparkRBatch }}',
'{{ sparkSqlBatch }}',
'{{ labels }}',
'{{ runtimeConfig }}',
'{{ environmentConfig }}'
;

DELETE example

Deletes the specified batches resource.

/*+ delete */
DELETE FROM google.dataproc.batches
WHERE batchesId = '{{ batchesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';