def download_output(project_id, cluster_id, output_bucket, job_id):
 print 'Downloading output file'
 client = storage.Client(project=project_id)
 bucket = client.get_bucket(output_bucket)
 output_blob = 'google-cloud-dataproc-metainfo/{}/jobs/{}/driveroutput.000000000'.format(cluster_id, job_id)
 return bucket.blob(output_blob).download_as_string()

def download_output ( project_id , cluster_id , output_bucket , job_id ) : print 'Downloading output file' client = storage . Client ( project = project_id ) bucket = client . get_bucket ( output_bucket ) output_blob = 'google-cloud-dataproc-metainfo/{}/jobs/{}/driveroutput.000000000' . format ( cluster_id , job_id ) return bucket . blob ( output_blob ) . download_as_string ( )
downloads the output file from cloud storage and returns it as a string .