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

BigQuery FILE_LOADS fails with ALLOW_FIELD_ADDITION set

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Duplicate
    • 2.29.0
    • Not applicable
    • io-java-gcp
    • None

    Description

      While running a job on Dataflow that writes to BigQuery using the `FILE_LOADS` write method I notice the following error in the `MultiPartitionsWriteTables` step:

       

      {"errorResult":\{"message":"Schema update options should only be specified with WRITE_APPEND disposition, or with WRITE_TRUNCATE disposition on a table partition.","reason":"invalid"},"errors":[\{"message":"Schema update options should only be specified with WRITE_APPEND disposition, or with WRITE_TRUNCATE disposition on a table partition.","reason":"invalid"}],"state":"DONE"}
      

       

      Here's the write configuration that I'm using:

      BigQueryIO
       .write()
       .to(...)
       .withSchema(...)
       .withFormatFunction(...)
       .withCreateDisposition(CREATE_IF_NEEDED)
       .withWriteDisposition(WRITE_APPEND)
      .withSchemaUpdateOptions(Collections.singleton(SchemaUpdateOption.ALLOW_FIELD_ADDITION))
       .withTimePartitioning(new TimePartitioning().setType("DAY").setRequirePartitionFilter(false).setField("ts"))
       .withMethod(Method.FILE_LOADS)
       .withTriggeringFrequency(Minutes.minutes(5).toStandardDuration)
       .withAutoSharding()
       .optimizedWrites()

       

      I believe it is due to the fact that the schema update options are being passed to the `WriteTables` constructor for the temp tables here. It might be okay to just pass `null` there instead since I don't think we need the schema update options if we're always generating those temp tables from scratch, but I'm not sure if that will have other consequences.

      This is preventing any of the load jobs from completing, causing none of the data to ever make it to the BigQuery table.

      Attachments

        Issue Links

          Activity

            People

              crcornwell Christopher Cornwell
              crcornwell Christopher Cornwell
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h