[Feature Request]: [Java BQ] Support storageApiAppendThresholdRecordCount option when streaming with STORAGE_WRITE_API
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
### What would you like to happen?
When streaming with STORAGE_WRITE_API, we use the [StorageApiWritesShardedRecords](https://github.com/apache/beam/blob/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiWritesShardedRecords.java) path, which splits the messages in terms of the byte size threshold (`storageApiAppendThresholdBytes`). However, the record count threshold (`storageApiAppendThresholdRecordCount`) is essentially ignored.
The splitting logic exists in [SplittingIterable](https://github.com/apache/beam/blob/master/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/SplittingIterable.java). We should be making a similar check as [here](https://github.com/apache/beam/blob/1f90261aef435d947db5eff30172afa3e7d4fd27/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/SplittingIterable.java#L146-L148), but for accumulated record count.
### Issue Priority
Priority: 3 (nice-to-have improvement)
### Issue Components
- [ ] Component: Python SDK
- [X] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [X] Component: IO connector
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
Contributor guide
Assessment
This issue has not been assessed yet.