{"record":{"id":"d2053e6de5a7db0a","repo":"apache/beam","slug":"setting-the-number-of-storage-api-streams-is-only-applicable","errorCode":null,"errorMessage":"Setting the number of Storage API streams is only applicable to an unbounded PCollection.","messagePattern":"Setting the number of Storage API streams is only applicable to an unbounded PCollection\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java","lineNumber":3911,"sourceCode":"                method);\n          }\n        }\n      } else { // PCollection is bounded\n        checkArgument(\n            getTriggeringFrequency() == null,\n            \"Triggering frequency is only applicable to an unbounded PCollection.\");\n        checkArgument(\n            !getAutoSharding(), \"Auto-sharding is only applicable to an unbounded PCollection.\");\n        checkArgument(\n            getNumFileShards() == 0,\n            \"Number of file shards is only applicable to an unbounded PCollection.\");\n\n        if (getStorageApiTriggeringFrequency(bqOptions) != null) {\n          LOG.warn(\n              \"Setting the triggering frequency is only applicable to an unbounded PCollection.\");\n        }\n        if (getStorageApiNumStreams(bqOptions) != 0) {\n          LOG.warn(\n              \"Setting the number of Storage API streams is only applicable to an unbounded PCollection.\");\n        }\n      }\n\n      if (method == Method.STORAGE_API_AT_LEAST_ONCE && getStorageApiNumStreams(bqOptions) != 0) {\n        LOG.warn(\n            \"Setting a number of Storage API streams is only supported when using STORAGE_WRITE_API\");\n      }\n\n      if (method != Method.STORAGE_WRITE_API && method != Method.STORAGE_API_AT_LEAST_ONCE) {\n        checkArgument(\n            !getAutoSchemaUpdate(),\n            \"withAutoSchemaUpdate only supported when using STORAGE_WRITE_API or STORAGE_API_AT_LEAST_ONCE.\");\n        checkArgument(\n            getBigLakeConfiguration() == null,\n            \"bigLakeConfiguration is only supported when using STORAGE_WRITE_API or STORAGE_API_AT_LEAST_ONCE.\");\n      } else {\n        if (getWriteDisposition() == WriteDisposition.WRITE_TRUNCATE) {","sourceCodeStart":3893,"sourceCodeEnd":3929,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java#L3893-L3929","documentation":"The number of Storage API write streams (numStorageWriteApiStreams) only makes sense for a streaming, unbounded write where Beam must decide how many concurrent streams to open. For a bounded PCollection the stream count is meaningless, so the value is ignored with this warning.","triggerScenarios":"Calling withStorageApiNumStreams(n) (getStorageApiNumStreams != 0) on a BigQueryIO write whose input PCollection is bounded.","commonSituations":"Shared sink-builder code reused between streaming and batch jobs, leaving a tuned stream count in the batch path.","solutions":["Remove withStorageApiNumStreams(...) from the bounded write","Confirm the source is meant to be unbounded; if it is, investigate why the pipeline sees it as bounded","Rely on default parallelism for bounded writes instead of fixed stream counts"],"exampleFix":"// before\nBigQueryIO.writeTableRows().to(table).withMethod(Method.STORAGE_WRITE_API).withStorageApiNumStreams(5) // bounded input\n// after\nBigQueryIO.writeTableRows().to(table).withMethod(Method.STORAGE_WRITE_API) // stream count removed","handlingStrategy":"validation","validationCode":"if (input.isBounded() == PCollection.IsBounded.BOUNDED && storageApiNumStreams != 0) { /* remove stream count */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set withStorageApiNumStreams only for unbounded STORAGE_WRITE_API writes","Parameterize streaming options so batch runs omit them","Verify source boundedness after pipeline refactors"],"tags":["java","apache-beam","bigquery","bounded-input"],"backgroundTag":"invalid-config-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}