{"record":{"id":"61ab027ca430eaac","repo":"apache/beam","slug":"table-is-required-for-batch-writes","errorCode":null,"errorMessage":"table is required for batch writes.","messagePattern":"table is required for batch writes\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeWriteSchemaTransformProvider.java","lineNumber":145,"sourceCode":"        Long flushTimeLimitMillis = configuration.getFlushTimeLimitMillis();\n        if (flushTimeLimitMillis != null) {\n          write = write.withFlushTimeLimit(Duration.millis(flushTimeLimitMillis));\n        }\n\n        Integer shardsNumber = configuration.getShardsNumber();\n        if (shardsNumber != null) {\n          write = write.withShardsNumber(shardsNumber);\n        }\n\n        String debugMode = configuration.getDebugMode();\n        if (debugMode != null) {\n          write = write.withDebugMode(parseStreamingLogLevel(debugMode));\n        }\n      } else {\n        String table = configuration.getTable();\n\n        if (table == null || table.isEmpty()) {\n          throw new IllegalArgumentException(\"table is required for batch writes.\");\n        }\n\n        write = write.to(table);\n\n        String createDispositionValue = configuration.getCreateDisposition();\n\n        if (createDispositionValue != null) {\n          CreateDisposition createDisposition = parseCreateDisposition(createDispositionValue);\n\n          write = write.withCreateDisposition(createDisposition);\n\n          if (createDisposition == CreateDisposition.CREATE_IF_NEEDED) {\n            write = write.withTableSchema(toSnowflakeTableSchema(rows.getSchema()));\n          }\n        }\n\n        String writeDispositionValue = configuration.getWriteDisposition();\n","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeWriteSchemaTransformProvider.java#L127-L163","documentation":"SnowflakeWriteSchemaTransformProvider.expand() classifies a bounded input as a batch write, which must target a Snowflake table. If the table field is null or empty for a batch write, it throws this IllegalArgumentException during pipeline construction.","triggerScenarios":"Applying the Snowflake write SchemaTransform to a bounded PCollection with the table config field omitted or empty (e.g. only snowPipe/staging settings supplied).","commonSituations":"Reusing a streaming-write config (which uses snowPipe, not table) for a batch pipeline, or the table key is misspelled/missing in the transform's YAML config.","solutions":["Set table in the configuration to the target table, e.g. table: MY_DB.MY_SCHEMA.MY_TABLE.","If the write is meant to be streaming, ensure the input PCollection is unbounded and snowPipe is set instead.","Check the YAML/config key spelling so the table value actually reaches the provider."],"exampleFix":"// before\nconfig: {serverName: ..., database: ...} // batch input, no table\n// after\nconfig: {serverName: ..., database: ..., table: \"MY_DB.MY_SCHEMA.MY_TABLE\"}","handlingStrategy":"validation","validationCode":"boolean batch = pcollection.isBounded() == PCollection.IsBounded.BOUNDED;\nif (batch && (config.getTable() == null || config.getTable().isEmpty())) {\n  throw new IllegalArgumentException(\"Batch input requires table to be set\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  return applyTransform(input, config);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"table is required\")) { /* add table config */ }\n  throw e;\n}","preventionTips":["Keep separate config templates for batch (table) and streaming (snowPipe) writes.","Verify YAML keys against the provider's documented schema before deploying.","Smoke-test pipeline expansion locally with a bounded source to catch missing table config early."],"tags":["java","snowflake","batch","configuration"],"backgroundTag":"missing-required-config-field","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"}