You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 18:18:15 UTC

[GitHub] [beam] damccorm opened a new issue, #20618: BigQueryServicesImpl.insertAll evaluates maxRowBatchSize after a row is added to the batch

damccorm opened a new issue, #20618:
URL: https://github.com/apache/beam/issues/20618

   When using the `BigQueryIO.Write` transformation, a set of pipeline options defined in `BigQueryOptions` become available to the pipeline. 
   
   Two of these options being: 
     * `maxStreamingRowsToBatch` - "The maximum number of rows to batch in a single streaming insert to BigQuery." 
     * `maxStreamingBatchSize` - "The maximum byte size of a single streaming insert to BigQuery" 
   
   Reading the description of the `maxStreamingBatchSize`, I am given the impression that the BigQuery sink will ensure that each batch is either on, or under, the max byte size configured. 
   
   But after [reviewing the code of the internal sink transformation](https://github.com/apache/beam/blob/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryServicesImpl.java#L826), I can see that the batching code will first add a row to the batch and then compares the new batch size against the maximum configured. 
   
   The description of the option, `maxStreamingBatchSize`, gives the end user an impression that this will protect them from batches that will exceed the size limit of the BigQuery streaming inserts API. 
   
   When in reality it can lead to a situation where a batch is produced that massively exceeds the limit and the transformation will get stuck into a loop of constantly retrying the request.
   
   Imported from Jira [BEAM-11330](https://issues.apache.org/jira/browse/BEAM-11330). Original Jira may contain additional context.
   Reported by: liamhaworth01.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org