Fix BigQuery Storage Write API stream count for batch writes#38777
Fix BigQuery Storage Write API stream count for batch writes#38777SPUERSAIYAN wants to merge 4 commits into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where batch pipelines using the BigQuery Storage Write API were unable to utilize fixed stream counts. By modifying the schema transform logic, the changes ensure that configured stream counts are respected in batch contexts, while maintaining existing auto-sharding behavior exclusively for streaming pipelines. The update also cleans up documentation and includes a validation test to ensure consistent behavior across pipeline types. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the BigQuery Storage Write API implementation and documentation to support configuring the number of write streams for both batch and streaming pipelines, rather than limiting it to streaming pipelines. It modifies the schema transform provider to apply the stream count configuration to both bounded and unbounded writes and adds a corresponding unit test. The review feedback highlights two issues in the schema transform provider: a lack of validation for negative stream counts and an issue where explicitly setting the stream count to zero is ignored, preventing users from overriding pipeline options. A code suggestion is provided to resolve these issues.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
|
Assigning reviewers: R: @tvalentyn for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
I see there is also #38776 , which looks a bit simpler. |
What changed
Fixes #38770
This fixes handling of
num_storage_api_streams/num_streamsfor BigQuery Storage Write API batch writes.Previously, the Java schema transform only applied
num_streamsinside the unbounded pipeline branch, so bounded batch pipelines using the Storage Write API ignored the configured fixed stream count. This change applieswithNumStorageWriteApiStreams(...)whenevernum_streams > 0, while keeping triggering frequency and auto-sharding behavior limited to unbounded pipelines.Details
auto_shardingas an unbounded-only option.num_storage_api_streams/num_streamsas streaming-only.Validation
git diff --check./gradlew.bat --no-daemon --console=plain :sdks:java:io:google-cloud-platform:spotlessCheckCHANGES.md
Not updated because this is a targeted behavior/documentation fix rather than a broad user-facing feature addition.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.