gcp apache spark deployment quickstart
We can deploy a spark job without creating any cluster in GCP and this is a quickstart that we will be doing today with the followings commands:- # enabling services gcloud services enable dataproc.googleapis.com bigquery.googleapis.com # Creating the bucket export BUCKET = $ (gcloud config get - value project) - spark - demo gcloud storage buckets create gs: // $ BUCKET -- location = us - central1 bq mk -- location = US wordcount_dataset And this is the code that we will be using import sys from pyspark.sql import SparkSession, functions as F bucket = sys . argv [ 1 ] spark = SparkSession.builder.appName( "shakespeare-wordcount" ).getOrCreate() spark .conf.set( "temporaryGcsBucket" , bucket ) # staging area for the BigQuery write # 1. READ from BigQuery words = ( spark .read.format( "bigquery" ) .option( "table" , "bigquery-public-data:samples.shakespeare" ) .load() ...