{"record":{"id":"949c15b59a503369","repo":"apache/beam","slug":"name-cannot-be-empty-snowflakewriteconfiguration","errorCode":null,"errorMessage":"${name} cannot be empty","messagePattern":"(.+?) cannot be empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeWriteConfiguration.java","lineNumber":176,"sourceCode":"    Integer flushRowLimit = getFlushRowLimit();\n    if (flushRowLimit != null && flushRowLimit <= 0) {\n      throw new IllegalArgumentException(\"flushRowLimit must be greater than 0.\");\n    }\n\n    Long flushTimeLimitMillis = getFlushTimeLimitMillis();\n    if (flushTimeLimitMillis != null && flushTimeLimitMillis <= 0) {\n      throw new IllegalArgumentException(\"flushTimeLimitMillis must be greater than 0.\");\n    }\n\n    Integer shardsNumber = getShardsNumber();\n    if (shardsNumber != null && shardsNumber <= 0) {\n      throw new IllegalArgumentException(\"shardsNumber must be greater than 0.\");\n    }\n  }\n\n  private static void requireNonEmpty(String value, String name) {\n    if (value == null || value.isEmpty()) {\n      throw new IllegalArgumentException(name + \" cannot be empty\");\n    }\n  }\n\n  @AutoValue.Builder\n  public abstract static class Builder {\n\n    public abstract Builder setServerName(String value);\n\n    public abstract Builder setUsername(@Nullable String value);\n\n    public abstract Builder setPassword(@Nullable String value);\n\n    public abstract Builder setOauthToken(@Nullable String value);\n\n    public abstract Builder setPrivateKey(@Nullable String value);\n\n    public abstract Builder setPrivateKeyPassphrase(@Nullable String value);\n","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeWriteConfiguration.java#L158-L194","documentation":"SnowflakeWriteConfiguration.requireNonEmpty() throws '<name> cannot be empty' when a mandatory string configuration field (such as storageIntegrationName, serverName, database, schema, or stagingBucketName) is null or an empty string. validate() calls this helper for each required field, failing fast at pipeline construction with an IllegalArgumentException whose message names the offending property.","triggerScenarios":"Building a SnowflakeWriteConfiguration (or using the Snowflake write SchemaTransform) without setting any required string field, e.g. omitting storageIntegrationName/serverName/database/schema, or setting one to \"\".","commonSituations":"Config values read from environment variables or flags that are unset (empty string), YAML keys commented out, or typo'd builder method so the expected field never gets populated.","solutions":["Read the message to identify which '<name>' is empty and set it on the builder/transform, e.g. .withStorageIntegrationName(\"MY_INTEGRATION\").","Validate upstream inputs (env vars, flags, config files) before building the configuration.","Check for typos between config keys and builder methods so values actually reach the builder."],"exampleFix":"// before\nSnowflakeIO.write().withStagingBucketName(\"\")\n// after\nSnowflakeIO.write().withStagingBucketName(\"gs://my-bucket/\")","handlingStrategy":"validation","validationCode":"for (Map.Entry<String,String> e : requiredStrings.entrySet()) {\n  if (e.getValue() == null || e.getValue().isEmpty()) {\n    throw new IllegalArgumentException(e.getKey() + \" cannot be empty\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  config.validate();\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().endsWith(\"cannot be empty\")) { /* set the named field and retry */ }\n  throw e;\n}","preventionTips":["Fail fast at startup: read all env vars/flags into a validated config object before building the pipeline.","Never pass raw env var strings (which may be empty) directly into builder methods.","Keep a checklist of required Snowflake fields (serverName, database, schema, storageIntegrationName, stagingBucketName) and assert all are present in tests."],"tags":["java","configuration","snowflake","missing-field"],"backgroundTag":"empty-required-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"}