apache/beam · error · InvalidPropertyException

Invalid method ' '. Supported methods are: .

Error message

Invalid method '%s'. Supported methods are: %s.

What it means

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.

Solutions

  1. Set method to one of the listed valid values in the error message (e.g. TABLE, QUERY, EXTERNAL)
  2. Fix typos in the DDL's WITH options for the BigQuery table
  3. Check the Beam version's supported Method enum values and upgrade if a newer method is needed

Example fix

// before
CREATE EXTERNAL TABLE t (...) TYPE bigquery WITH method='TABLEE'
// after
CREATE EXTERNAL TABLE t (...) TYPE bigquery WITH method='TABLE'
Defensive patterns

Strategy: validation

Validate before calling

// before DDL
Set<String> valid = Set.of("TABLE", "QUERY", "EXTERNAL");
String m = props.get("method").asText().toUpperCase();
if (!valid.contains(m)) throw new IllegalArgumentException("method must be one of " + valid);

Type guard

boolean isValidMethod(String s) {
  try { Method.valueOf(s.toUpperCase()); return true; } catch (IllegalArgumentException e) { return false; }
}

Try / catch

try {
  createBigQueryTable(properties);
} catch (InvalidPropertyException e) {
  if (e.getMessage().startsWith("Invalid method")) { /* fix WITH clause and retry */ }
  throw e;
}

Prevention

When it happens

Trigger: 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'.

Common situations: Typos in the WITH clause method option in DDL; copying config from another connector; Beam version lacking a newly added method enum value.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/c011036c7acb06e6. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/bigquery/BigQueryTable.java:93

  private static final Logger LOG = LoggerFactory.getLogger(BigQueryTable.class);
  @VisibleForTesting final Method method;
  @VisibleForTesting final WriteDisposition writeDisposition;

  BigQueryTable(Table table, BigQueryUtils.ConversionOptions options) {
    super(table.getSchema());
    this.conversionOptions = options;
    this.bqLocation = table.getLocation();

    if (table.getProperties().has(METHOD_PROPERTY)) {
      List<String> validMethods =
          Arrays.stream(Method.values()).map(Enum::toString).collect(Collectors.toList());
      // toUpperCase should make it case-insensitive
      String selectedMethod = table.getProperties().get(METHOD_PROPERTY).asText().toUpperCase();

      if (validMethods.contains(selectedMethod)) {
        method = Method.valueOf(selectedMethod);
      } else {
        throw new InvalidPropertyException(
            "Invalid method "
                + "'"
                + selectedMethod
                + "'. "
                + "Supported methods are: "
                + validMethods.toString()
                + ".");
      }
    } else {
      method = Method.DIRECT_READ;
    }

    LOG.info("BigQuery method is set to: {}", method);

    if (table.getProperties().has(WRITE_DISPOSITION_PROPERTY)) {
      List<String> validWriteDispositions =
          Arrays.stream(WriteDisposition.values()).map(Enum::toString).collect(Collectors.toList());
      // toUpperCase should make it case-insensitive

View on GitHub (pinned to 12126d8942)