{"record":{"id":"4a64040ee058b290","repo":"apache/beam","slug":"setting-a-number-of-storage-api-streams-is-only-supported","errorCode":null,"errorMessage":"Setting a number of Storage API streams is only supported when using STORAGE_WRITE_API","messagePattern":"Setting a number of Storage API streams is only supported when using STORAGE_WRITE_API","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":3917,"sourceCode":"            \"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) {\n          LOG.error(\"The Storage API sink does not support the WRITE_TRUNCATE write disposition.\");\n        }\n        Map<String, String> bigLakeConfiguration = getBigLakeConfiguration();\n        if (bigLakeConfiguration != null) {\n          checkArgument(\n              Arrays.stream(new String[] {CONNECTION_ID, STORAGE_URI})","sourceCodeStart":3899,"sourceCodeEnd":3935,"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#L3899-L3935","documentation":"Configuring a fixed number of Storage API write streams is only supported for the STORAGE_WRITE_API method. When STORAGE_API_AT_LEAST_ONCE is selected, the write path does not use a fixed stream pool, so any configured stream count is ignored and this warning is logged.","triggerScenarios":"Setting withStorageApiNumStreams(n) (or the numStorageWriteApiStreams option) while the write method is Method.STORAGE_API_AT_LEAST_ONCE.","commonSituations":"Pipelines migrated from STORAGE_WRITE_API to at-least-once mode for lower cost/complexity, keeping the stream-count tuning from the previous method.","solutions":["Remove withStorageApiNumStreams(...) when using STORAGE_API_AT_LEAST_ONCE","Switch back to Method.STORAGE_WRITE_API if a fixed stream count is genuinely needed","Use withAutoSharding() to control parallelism in at-least-once mode instead"],"exampleFix":"// before\nBigQueryIO.writeTableRows().to(table).withMethod(Method.STORAGE_API_AT_LEAST_ONCE).withStorageApiNumStreams(5)\n// after\nBigQueryIO.writeTableRows().to(table).withMethod(Method.STORAGE_API_AT_LEAST_ONCE) // stream count removed","handlingStrategy":"validation","validationCode":"if (method == Method.STORAGE_API_AT_LEAST_ONCE && storageApiNumStreams != 0) { /* remove withStorageApiNumStreams */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat numStorageWriteApiStreams as STORAGE_WRITE_API-only","Audit options after migrating between Storage API write modes","Prefer auto-sharding for at-least-once parallelism control"],"tags":["java","apache-beam","bigquery","configuration"],"backgroundTag":"conflicting-config-options","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"}