Skip to main content

jobs

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

Overview

Namejobs
TypeResource
Idgoogle.dataproc.jobs

Fields

NameDatatypeDescription
donebooleanOutput only. Indicates whether the job is completed. If the value is false, the job is still in progress. If true, the job is completed, and status.state field will indicate if it was successful, failed, or cancelled.
driverControlFilesUristringOutput only. If present, the location of miscellaneous control files which can be used as part of job setup and handling. If not present, control files might be placed in the same location as driver_output_uri.
driverOutputResourceUristringOutput only. A URI pointing to the location of the stdout of the job's driver program.
driverSchedulingConfigobjectDriver scheduling configuration.
flinkJobobjectA Dataproc job for running Apache Flink applications on YARN.
hadoopJobobjectA Dataproc job for running Apache Hadoop MapReduce (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) jobs on Apache Hadoop YARN (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html).
hiveJobobjectA Dataproc job for running Apache Hive (https://hive.apache.org/) queries on YARN.
jobUuidstringOutput only. A UUID that uniquely identifies a job within the project over time. This is in contrast to a user-settable reference.job_id that might be reused over time.
labelsobjectOptional. The labels to associate with this job. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values can 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 job.
pigJobobjectA Dataproc job for running Apache Pig (https://pig.apache.org/) queries on YARN.
placementobjectDataproc job config.
prestoJobobjectA Dataproc job for running Presto (https://prestosql.io/) queries. IMPORTANT: The Dataproc Presto Optional Component (https://cloud.google.com/dataproc/docs/concepts/components/presto) must be enabled when the cluster is created to submit a Presto job to the cluster.
pysparkJobobjectA Dataproc job for running Apache PySpark (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) applications on YARN.
referenceobjectEncapsulates the full scoping used to reference a job.
schedulingobjectJob scheduling options.
sparkJobobjectA Dataproc job for running Apache Spark (https://spark.apache.org/) applications on YARN.
sparkRJobobjectA Dataproc job for running Apache SparkR (https://spark.apache.org/docs/latest/sparkr.html) applications on YARN.
sparkSqlJobobjectA Dataproc job for running Apache Spark SQL (https://spark.apache.org/sql/) queries.
statusobjectDataproc job status.
statusHistoryarrayOutput only. The previous job status.
trinoJobobjectA Dataproc job for running Trino (https://trino.io/) queries. IMPORTANT: The Dataproc Trino Optional Component (https://cloud.google.com/dataproc/docs/concepts/components/trino) must be enabled when the cluster is created to submit a Trino job to the cluster.
yarnApplicationsarrayOutput only. The collection of YARN applications spun up by this job.Beta Feature: This report is available for testing purposes only. It might be changed before final release.

Methods

NameAccessible byRequired ParamsDescription
projects_regions_jobs_getSELECTjobId, projectId, regionGets the resource representation for a job in a project.
projects_regions_jobs_listSELECTprojectId, regionLists regions/{region}/jobs in a project.
projects_regions_jobs_deleteDELETEjobId, projectId, regionDeletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.
projects_regions_jobs_patchUPDATEjobId, projectId, regionUpdates a job in a project.
projects_regions_jobs_cancelEXECjobId, projectId, regionStarts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or regions/{region}/jobs.get (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).
projects_regions_jobs_submitEXECprojectId, regionSubmits a job to a cluster.
projects_regions_jobs_submit_as_operationEXECprojectId, regionSubmits job to a cluster.

SELECT examples

Lists regions/{region}/jobs in a project.

SELECT
done,
driverControlFilesUri,
driverOutputResourceUri,
driverSchedulingConfig,
flinkJob,
hadoopJob,
hiveJob,
jobUuid,
labels,
pigJob,
placement,
prestoJob,
pysparkJob,
reference,
scheduling,
sparkJob,
sparkRJob,
sparkSqlJob,
status,
statusHistory,
trinoJob,
yarnApplications
FROM google.dataproc.jobs
WHERE projectId = '{{ projectId }}'
AND region = '{{ region }}';

UPDATE example

Updates a jobs resource.

/*+ update */
UPDATE google.dataproc.jobs
SET
reference = '{{ reference }}',
placement = '{{ placement }}',
hadoopJob = '{{ hadoopJob }}',
sparkJob = '{{ sparkJob }}',
pysparkJob = '{{ pysparkJob }}',
hiveJob = '{{ hiveJob }}',
pigJob = '{{ pigJob }}',
sparkRJob = '{{ sparkRJob }}',
sparkSqlJob = '{{ sparkSqlJob }}',
prestoJob = '{{ prestoJob }}',
trinoJob = '{{ trinoJob }}',
flinkJob = '{{ flinkJob }}',
labels = '{{ labels }}',
scheduling = '{{ scheduling }}',
driverSchedulingConfig = '{{ driverSchedulingConfig }}'
WHERE
jobId = '{{ jobId }}'
AND projectId = '{{ projectId }}'
AND region = '{{ region }}';

DELETE example

Deletes the specified jobs resource.

/*+ delete */
DELETE FROM google.dataproc.jobs
WHERE jobId = '{{ jobId }}'
AND projectId = '{{ projectId }}'
AND region = '{{ region }}';