Skip to content

[Java][BigQueryIO] Honor allowMissingRequiredFields when building Storage Write API messages - #40204

Open
khaledh wants to merge 2 commits into
apache:masterfrom
khaledh:perf/honor-allow-missing-required-fields-at-build
Open

khaledh wants to merge 2 commits into
apache:masterfrom
khaledh:perf/honor-allow-missing-required-fields-at-build

Conversation

@khaledh

@khaledh khaledh commented Sep 21, 2026

Copy link
Copy Markdown

fixes #40189

When allowMissingRequiredFields is true, conversion already skips the missing-required check, but both build sites still call build(), which re-validates the whole tree and can throw. This makes the flag consistent at build time:

return allowMissingRequiredFields ? builder.buildPartial() : builder.build();
  • false path unchanged; a nested test pins the exact SchemaMissingRequiredFieldException diagnostic.
  • In-tree callers passing true already use all-optional descriptors: identical output, one redundant isInitialized() walk removed.
  • Behavior change, declared in CHANGES.md: an external caller passing true with a strict descriptor now gets a partial message instead of UninitializedMessageException. A one-time descriptor check can be added if preferred.
  • Dataflow, production workload: −12% CPU/record alone; −34% CPU and +46% throughput combined with [Feature Request]: Avoid per-field Descriptor.findFieldByName lookups in BigQuery Storage Write API TableRow conversion #40188.

Tests: on/off parity for all-optional descriptors including unknown fields, strict-path failure unchanged, nested diagnostic chain, partial messages for map and positional rows. GCP IO suite green on JDK 11 and 17.

Related: #40188 (independent; either order).


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: 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, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

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)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @kennknowles for label java.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@kennknowles

Copy link
Copy Markdown
Member

R: @ahmedabu98

Sorry to send so many to you, but am I right that you are the current expert in the storage write API paths?

@github-actions

Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Honor allowMissingRequiredFields when building Storage Write API messages from TableRow

2 participants