NOTE: This repository is part of Google Cloud PHP. Any
support requests, bug reports, or development contributions should be directed to
that project.
A managed Apache Spark and Apache Hadoop service that lets you take advantage of open source data tools for batch
processing, querying, streaming, and machine learning. Cloud Dataproc automation helps you create clusters quickly,
manage them easily, and save money by turning clusters off when you don't need them. With less time and money spent on
administration, you can focus on your jobs and your data.
Installation
To begin, install the preferred dependency manager for PHP, Composer.
Now install this component:
$ composer require google/cloud-dataproc
This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods)
please see our gRPC installation guide.
Authentication
Please see our Authentication guide for more information
on authenticating your client. Once authenticated, you'll be ready to start making requests.
Sample
require 'vendor/autoload.php';
use Google\Cloud\Dataproc\V1\JobControllerClient;
use Google\Cloud\Dataproc\V1\Job;
use Google\Cloud\Dataproc\V1\HadoopJob;
use Google\Cloud\Dataproc\V1\JobPlacement;
$projectId = '[MY_PROJECT_ID]';
$region = 'global';
$clusterName = '[MY_CLUSTER]';
$jobPlacement = new JobPlacement();
$jobPlacement->setClusterName($clusterName);
$hadoopJob = new HadoopJob();
$hadoopJob->setMainJarFileUri('gs://my-bucket/my-hadoop-job.jar');
$job = new Job();
$job->setPlacement($jobPlacement);
$job->setHadoopJob($hadoopJob);
$jobControllerClient = new JobControllerClient();
$submittedJob = $jobControllerClient->submitJob($projectId, $region, $job);
Version
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in
any minor or patch releases. We will address issues and requests with the highest priority.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["Version latestkeyboard_arrow_down\n\n- [3.14.0 (latest)](/php/docs/reference/cloud-dataproc/latest)\n- [3.13.4](/php/docs/reference/cloud-dataproc/3.13.4)\n- [3.12.0](/php/docs/reference/cloud-dataproc/3.12.0)\n- [3.11.0](/php/docs/reference/cloud-dataproc/3.11.0)\n- [3.10.1](/php/docs/reference/cloud-dataproc/3.10.1)\n- [3.9.0](/php/docs/reference/cloud-dataproc/3.9.0)\n- [3.8.1](/php/docs/reference/cloud-dataproc/3.8.1)\n- [3.7.1](/php/docs/reference/cloud-dataproc/3.7.1)\n- [3.6.1](/php/docs/reference/cloud-dataproc/3.6.1)\n- [3.5.1](/php/docs/reference/cloud-dataproc/3.5.1)\n- [3.4.0](/php/docs/reference/cloud-dataproc/3.4.0)\n- [3.3.0](/php/docs/reference/cloud-dataproc/3.3.0)\n- [3.2.2](/php/docs/reference/cloud-dataproc/3.2.2)\n- [2.6.1](/php/docs/reference/cloud-dataproc/2.6.1)\n- [2.5.0](/php/docs/reference/cloud-dataproc/2.5.0)\n- [2.3.0](/php/docs/reference/cloud-dataproc/2.3.0)\n- [2.2.3](/php/docs/reference/cloud-dataproc/2.2.3)\n- [2.1.0](/php/docs/reference/cloud-dataproc/2.1.0)\n- [2.0.0](/php/docs/reference/cloud-dataproc/2.0.0) \n\nGoogle Cloud Dataproc for PHP\n=============================\n\n\u003e Idiomatic PHP client for [Google Cloud Dataproc](https://cloud.google.com/dataproc/).\n\n[](https://packagist.org/packages/google/cloud-dataproc) [](https://packagist.org/packages/google/cloud-dataproc)\n\n**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any\nsupport requests, bug reports, or development contributions should be directed to\nthat project.\n\nA managed Apache Spark and Apache Hadoop service that lets you take advantage of open source data tools for batch\nprocessing, querying, streaming, and machine learning. Cloud Dataproc automation helps you create clusters quickly,\nmanage them easily, and save money by turning clusters off when you don't need them. With less time and money spent on\nadministration, you can focus on your jobs and your data.\n\n### Installation\n\nTo begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/).\n\nNow install this component: \n\n $ composer require google/cloud-dataproc\n\nThis component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods)\nplease see our [gRPC installation guide](https://cloud.google.com/php/grpc).\n\n### Authentication\n\nPlease see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information\non authenticating your client. Once authenticated, you'll be ready to start making requests.\n\n### Sample\n\n require 'vendor/autoload.php';\n\n use Google\\Cloud\\Dataproc\\V1\\JobControllerClient;\n use Google\\Cloud\\Dataproc\\V1\\Job;\n use Google\\Cloud\\Dataproc\\V1\\HadoopJob;\n use Google\\Cloud\\Dataproc\\V1\\JobPlacement;\n\n $projectId = '[MY_PROJECT_ID]';\n $region = 'global';\n $clusterName = '[MY_CLUSTER]';\n\n $jobPlacement = new JobPlacement();\n $jobPlacement-\u003esetClusterName($clusterName);\n\n $hadoopJob = new HadoopJob();\n $hadoopJob-\u003esetMainJarFileUri('gs://my-bucket/my-hadoop-job.jar');\n\n $job = new Job();\n $job-\u003esetPlacement($jobPlacement);\n $job-\u003esetHadoopJob($hadoopJob);\n\n $jobControllerClient = new JobControllerClient();\n $submittedJob = $jobControllerClient-\u003esubmitJob($projectId, $region, $job);\n\n### Version\n\nThis component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in\nany minor or patch releases. We will address issues and requests with the highest priority.\n\n### Next Steps\n\nTake a look at and understand the [official documentation](https://cloud.google.com/dataproc/docs)."]]