Dataproc
GCP · 14 questions
Short notes
Key idea
Dataproc runs managed Spark and Hadoop clusters on Google Cloud. Use it when you already have Spark code or need Spark's libraries; create a cluster for a job and delete it afterwards, or use Dataproc Serverless.
Syntax
gcloud dataproc clusters create etl --region=asia-south1 \
--num-workers=2 --max-idle=30m
gcloud dataproc jobs submit pyspark job.py --cluster=etl --region=asia-south1
gcloud dataproc batches submit pyspark job.py --region=asia-south1 # serverless
- Read and write
gs://paths directly (data in GCS, not HDFS). - Preemptible/spot secondary workers lower cost.
- Connectors for BigQuery and Cloud Storage.
Example
A nightly PySpark job turns a day of raw JSON in GCS into partitioned Parquet. Airflow creates the cluster, submits the job and deletes the cluster, so you pay for about 20 minutes a day.
Traps
- A forgotten cluster bills around the clock; set
--max-idleor use Serverless. - Storing data on cluster disks (HDFS) loses it when the cluster is deleted; use GCS.
- Choose Dataproc for Spark, BigQuery for SQL, and Dataflow for Beam/streaming.
- Spot workers can disappear mid-job; keep the main workers on standard VMs.
Want the full lesson with step-by-step examples, a project and a certificate? GCP course, ₹120 →
Questions
5 free questions- Question 1easy
What is Dataproc?
- Question 2medium
A Spark job runs for 40 minutes each night. What's the most cost-efficient setup?
- Question 3medium
Why keep Dataproc input and output in Cloud Storage instead of the cluster's HDFS?
- Question 4medium
When are Spot (preemptible) secondary workers a good idea?
- Question 5medium
Data scientists run Spark notebooks interactively all day. Which Dataproc option fits best?
Dataproc
Dataproc
Dataproc
Dataproc
Dataproc
9 more questions on this topic, with hints, and tests
Sign up free for 21 days of every question and test.