{"record":{"id":"c011036c7acb06e6","repo":"apache/beam","slug":"invalid-method-s-supported-methods-are-s","errorCode":null,"errorMessage":"Invalid method '%s'. Supported methods are: %s.","messagePattern":"Invalid method '(.+?)'\\. Supported methods 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":93,"sourceCode":"  private static final Logger LOG = LoggerFactory.getLogger(BigQueryTable.class);\n  @VisibleForTesting final Method method;\n  @VisibleForTesting final WriteDisposition writeDisposition;\n\n  BigQueryTable(Table table, BigQueryUtils.ConversionOptions options) {\n    super(table.getSchema());\n    this.conversionOptions = options;\n    this.bqLocation = table.getLocation();\n\n    if (table.getProperties().has(METHOD_PROPERTY)) {\n      List<String> validMethods =\n          Arrays.stream(Method.values()).map(Enum::toString).collect(Collectors.toList());\n      // toUpperCase should make it case-insensitive\n      String selectedMethod = table.getProperties().get(METHOD_PROPERTY).asText().toUpperCase();\n\n      if (validMethods.contains(selectedMethod)) {\n        method = Method.valueOf(selectedMethod);\n      } else {\n        throw new InvalidPropertyException(\n            \"Invalid method \"\n                + \"'\"\n                + selectedMethod\n                + \"'. \"\n                + \"Supported methods are: \"\n                + validMethods.toString()\n                + \".\");\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","sourceCodeStart":75,"sourceCodeEnd":111,"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#L75-L111","documentation":"When constructing a BigQueryTable from table properties, the value of the 'method' property is uppercased and validated against the set of valid methods (e.g. TABLE, QUERY, EXTERNAL). An unrecognized method string throws InvalidPropertyException listing the valid options, because the table cannot be created without a known read/write method.","triggerScenarios":"Creating a BigQuery external table whose properties include method set to something other than a valid Method enum name — e.g. typo 'TABLEE', lowercase handling aside, or an unsupported mode like 'STREAM'.","commonSituations":"Typos in the WITH clause method option in DDL; copying config from another connector; Beam version lacking a newly added method enum value.","solutions":["Set method to one of the listed valid values in the error message (e.g. TABLE, QUERY, EXTERNAL)","Fix typos in the DDL's WITH options for the BigQuery table","Check the Beam version's supported Method enum values and upgrade if a newer method is needed"],"exampleFix":"// before\nCREATE EXTERNAL TABLE t (...) TYPE bigquery WITH method='TABLEE'\n// after\nCREATE EXTERNAL TABLE t (...) TYPE bigquery WITH method='TABLE'","handlingStrategy":"validation","validationCode":"// before DDL\nSet<String> valid = Set.of(\"TABLE\", \"QUERY\", \"EXTERNAL\");\nString m = props.get(\"method\").asText().toUpperCase();\nif (!valid.contains(m)) throw new IllegalArgumentException(\"method must be one of \" + valid);","typeGuard":"boolean isValidMethod(String s) {\n  try { Method.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 method\")) { /* fix WITH clause and retry */ }\n  throw e;\n}","preventionTips":["Copy method values from the enum/docs verbatim","Validate DDL WITH options before deploying pipelines","Check the Method enum for your Beam version when upgrading"],"tags":["beam-sql","bigquery","invalid-property","ddl"],"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"}