Skip to content

Commit

Permalink
Merge pull request #30059 [YAML] Require numStreams for unbounded Big…
Browse files Browse the repository at this point in the history
…QueryStorageWrite

Require numStreams for unbounded BigQueryStorageWriteApiSchemaTransform xlang transform.

This is to work around #30058
  • Loading branch information
robertwb authored Jan 24, 2024
2 parents 0eefb79 + 8f3887b commit 11646ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,14 @@ public PCollectionRowTuple expand(PCollectionRowTuple input) {
Long triggeringFrequency = configuration.getTriggeringFrequencySeconds();
Boolean autoSharding = configuration.getAutoSharding();
int numStreams = configuration.getNumStreams() == null ? 0 : configuration.getNumStreams();

// TODO(https://github.com/apache/beam/issues/30058): remove once Dataflow supports multiple
// DoFn's per fused step.
if (numStreams < 1) {
throw new IllegalStateException(
"numStreams must be set to a positive integer when input data is unbounded.");
}

boolean useAtLeastOnceSemantics =
configuration.getUseAtLeastOnceSemantics() == null
? false
Expand Down
2 changes: 2 additions & 0 deletions sdks/python/apache_beam/yaml/standard_io.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
create_disposition: 'createDisposition'
write_disposition: 'writeDisposition'
error_handling: 'errorHandling'
# TODO(https://github.com/apache/beam/issues/30058): Required until autosharding support is fixed
num_streams: 'numStreams'
underlying_provider:
type: beamJar
transforms:
Expand Down

0 comments on commit 11646ca

Please sign in to comment.