I haven't tried BigQueryIO with Spark runner but this connector has been significantly updated since Beam 2.4.0. Can you try with latest Beam and also specify a GCS location with withCustomGcsTempLocation() parameter ? https://github.com/apache/beam/blob/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java#L1828
Thanks, Cham On Tue, Apr 16, 2019 at 7:18 AM shrikant bang <[email protected]> wrote: > Hi Team, > > I am trying to run an example code where my Source and Sink both are > BigQuery. I am using Beam SDK 2.4.0 with Spark 2.3.2. > > Here is typical flow of my example : read_bigquery => (map+shuffle) => > write_bigquery. > > However, I am getting issue as Spark writes intermediate cache > to yarn.nodemanager.local-dirs and BigQuery Write APIs expects source URI > as GCS. > > Caused by: java.io.IOException: Unable to insert job: > beam_load_example_job_id_00001_00000-0, aborting after 9 . > at > org.apache.beam.sdk.io.gcp.bigquery.BigQueryServicesImpl$JobServiceImpl.startJob(BigQueryServicesImpl.java:232) > at > org.apache.beam.sdk.io.gcp.bigquery.BigQueryServicesImpl$JobServiceImpl.startJob(BigQueryServicesImpl.java:203) > at > org.apache.beam.sdk.io.gcp.bigquery.BigQueryServicesImpl$JobServiceImpl.startLoadJob(BigQueryServicesImpl.java:143) > at > org.apache.beam.sdk.io.gcp.bigquery.WriteTables.load(WriteTables.java:262) > at > org.apache.beam.sdk.io.gcp.bigquery.WriteTables.access$600(WriteTables.java:79) > at > org.apache.beam.sdk.io.gcp.bigquery.WriteTables$WriteTablesDoFn.processElement(WriteTables.java:157) > Caused by: > com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad > Request > { > "code" : 400, > "errors" : [ { > "domain" : "global", > "message" : "Source URI must be a Google Cloud Storage location: > /mnt/hadoop/yarn/nm-local-dir/usercache/testuser/appcache/application_1553066291184_0001/container_1553066291184_0001_01_000004/gs:/dev-bucket/temp/BigQueryWriteTemp/beam_load_example_test_path1", > "reason" : "invalid" > } ], > "message" : "Source URI must be a Google Cloud Storage location: > /mnt/hadoop/yarn/nm-local-dir/usercache/testuser/appcache/application_1553066291184_0001/container_1553066291184_0001_01_000004/gs:/dev-bucket/temp/BigQueryWriteTemp/beam_load_example_test_path2" > } > > Am I missing anything with Pipeline configurations? I am passing > gcpTempLocation and tempLocation ( gs://dev-bucket/temp ) as parameters. > > Please suggest. > > Thank You, > Shrikant Bang > > > >
