{"record":{"id":"58562ba139bb6f91","repo":"apache/beam","slug":"invalid-write-disposition-s-supported-write-dispositions-are","errorCode":null,"errorMessage":"Invalid write disposition '%s'. Supported write dispositions are: %s.","messagePattern":"Invalid write disposition '(.+?)'\\. Supported write dispositions are: (.+?)\\.","errorType":"validation","errorClass":"InvalidPropertyException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/bigquery/BigQueryTable.java","lineNumber":118,"sourceCode":"                + \".\");\n      }\n    } else {\n      method = Method.DIRECT_READ;\n    }\n\n    LOG.info(\"BigQuery method is set to: {}\", method);\n\n    if (table.getProperties().has(WRITE_DISPOSITION_PROPERTY)) {\n      List<String> validWriteDispositions =\n          Arrays.stream(WriteDisposition.values()).map(Enum::toString).collect(Collectors.toList());\n      // toUpperCase should make it case-insensitive\n      String selectedWriteDisposition =\n          table.getProperties().get(WRITE_DISPOSITION_PROPERTY).asText().toUpperCase();\n\n      if (validWriteDispositions.contains(selectedWriteDisposition)) {\n        writeDisposition = WriteDisposition.valueOf(selectedWriteDisposition);\n      } else {\n        throw new InvalidPropertyException(\n            \"Invalid write disposition \"\n                + \"'\"\n                + selectedWriteDisposition\n                + \"'. \"\n                + \"Supported write dispositions are: \"\n                + validWriteDispositions.toString()\n                + \".\");\n      }\n    } else {\n      writeDisposition = WriteDisposition.WRITE_EMPTY;\n    }\n\n    LOG.info(\"BigQuery writeDisposition is set to: {}\", writeDisposition);\n  }\n\n  @Override\n  public BeamTableStatistics getTableStatistics(PipelineOptions options) {\n","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/bigquery/BigQueryTable.java#L100-L136","documentation":"During BigQueryTable construction, the write_disposition property is uppercased and validated against valid values (e.g. WRITE_APPEND, WRITE_EMPTY, WRITE_TRUNCATE). An unrecognized value throws InvalidPropertyException with the offending value and the list of supported dispositions.","triggerScenarios":"Creating a BigQuery table whose properties contain write_disposition set to an unknown string — typo like 'APPEND' or 'OVERWRITE' instead of the BigQuery API names, or mixed-case values not matching after uppercasing.","commonSituations":"Mapping habits from other systems (e.g. Spark's 'overwrite') into Beam's BigQuery DDL options; hand-edited pipeline config files; docs drift across Beam versions.","solutions":["Use one of the valid dispositions listed in the error (WRITE_APPEND, WRITE_EMPTY, WRITE_TRUNCATE)","Correct the property name/value in the CREATE EXTERNAL TABLE WITH options","Verify against the BigQueryTable WRITE_DISPOSITION constants for your Beam version"],"exampleFix":"// before\nWITH write_disposition='OVERWRITE'\n// after\nWITH write_disposition='WRITE_TRUNCATE'","handlingStrategy":"validation","validationCode":"// before DDL\nSet<String> valid = Set.of(\"WRITE_APPEND\", \"WRITE_EMPTY\", \"WRITE_TRUNCATE\");\nString wd = props.get(\"write_disposition\").asText().toUpperCase();\nif (!valid.contains(wd)) throw new IllegalArgumentException(\"write_disposition must be one of \" + valid);","typeGuard":"boolean isValidWriteDisposition(String s) {\n  try { WriteDisposition.valueOf(s.toUpperCase()); return true; } catch (IllegalArgumentException e) { return false; }\n}","tryCatchPattern":"try {\n  createBigQueryTable(properties);\n} catch (InvalidPropertyException e) {\n  if (e.getMessage().startsWith(\"Invalid write disposition\")) { /* correct WITH clause */ }\n  throw e;\n}","preventionTips":["Use BigQuery API disposition names (WRITE_APPEND/WRITE_EMPTY/WRITE_TRUNCATE), not other systems' terms","Centralize table DDL strings in config validated by tests","Re-validate DDL options after Beam upgrades"],"tags":["beam-sql","bigquery","invalid-property","write-disposition"],"backgroundTag":"invalid-enum-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"}