Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-1258

BigQueryIO.Write: CREATE_IF_NEEDED and per-window tables is broken

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • 0.4.0
    • 0.5.0
    • io-java-gcp
    • None

    Description

      User reported BigQuery error in beam 2.0:

      """
      Updating my streaming pipeline to 2.0 (org.beam). This is my code:

      .apply(BigQueryIO.Write.to(output)//
      .withSchema(schema)//
      .withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED));

      The error when pipeline is being deployed is below. After several such errors, the pipeline is deployed, but no table is ever created, so I don't get any output.

      Jan 09, 2017 3:44:13 PM org.apache.beam.sdk.io.gcp.bigquery.BigQueryServicesImpl executeWithRetries
      WARNING: Ignore the error and retry the request.
      com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
      {
      "code" : 404,
      "errors" : [

      { "domain" : "global", "message" : "Not found: Table myproject:mytable", "reason" : "notFound" }

      ],
      "message" : "Not found: Table myproject:mytable"
      }
      at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
      at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
      at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:321)
      at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1065)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
      at org.apache.beam.sdk.io.gcp.bigquery.BigQueryServicesImpl.executeWithRetries(BigQueryServicesImpl.java:860)
      at org.apache.beam.sdk.io.gcp.bigquery.BigQueryServicesImpl$DatasetServiceImpl.isTableEmpty(BigQueryServicesImpl.java:512)
      at org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO$Write$Bound.verifyTableEmpty(BigQueryIO.java:1836)
      at org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO$Write$Bound.validate(BigQueryIO.java:1886)
      at org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO$Write$Bound.validate(BigQueryIO.java:1623)
      at org.apache.beam.sdk.Pipeline.applyInternal(Pipeline.java:384)
      at org.apache.beam.sdk.Pipeline.applyTransform(Pipeline.java:299)
      at org.apache.beam.sdk.values.PCollection.apply(PCollection.java:154)
      at com.google.cloud.training.dataanalyst.javahelp.StreamDemoConsumer.main(StreamDemoConsumer.java:102)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293)
      at java.lang.Thread.run(Thread.java:745)

      Attachments

        Activity

          People

            peihe0@gmail.com Pei He
            peihe0@gmail.com Pei He
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: