-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fix BigQuery Storage Write API stream count for bounded writes #38776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,6 +101,12 @@ public void validate() { | |
|
|
||
| Boolean autoSharding = getAutoSharding(); | ||
| Integer numStreams = getNumStreams(); | ||
| if (numStreams != null) { | ||
|
stankiewicz marked this conversation as resolved.
|
||
| checkArgument( | ||
| numStreams >= 0, | ||
| invalidConfigMessage + "numStreams must be non-negative, but was: %s", | ||
| numStreams); | ||
| } | ||
|
Comment on lines
+104
to
+109
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If if (numStreams != null) {
checkArgument(
numStreams >= 0,
invalidConfigMessage + "numStreams must be non-negative, but was: %s",
numStreams);
if (numStreams == 0) {
checkArgument(
autoSharding != null && autoSharding,
invalidConfigMessage + "numStreams can only be 0 if autoSharding is enabled.");
}
}
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestion i looked into the existing BigQueryIO semantics and i think this validation would be broader than the scope of this PR.
Because Given that Id prefer not to add this validation unless a reviewer wants to intentionally change the accepted schema transform semantics for explicit |
||
| if (autoSharding != null && autoSharding && numStreams != null) { | ||
| checkArgument( | ||
| numStreams == 0, | ||
|
|
@@ -152,8 +158,7 @@ public static Builder builder() { | |
| public abstract Boolean getAutoSharding(); | ||
|
|
||
| @SchemaFieldDescription( | ||
| "Specifies the number of write streams that the Storage API sink will use. " | ||
| + "This parameter is only applicable when writing unbounded data.") | ||
| "Specifies the number of write streams that the Storage API sink will use.") | ||
| @Nullable | ||
| public abstract Integer getNumStreams(); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.