apache/beam · error · UnsupportedOperationException

Dropping tables is not supported with DataCatalog table prov

Error message

Dropping tables is not supported with DataCatalog table provider

What it means

Symmetric with createTable, the DataCatalog provider cannot delete table registrations. dropTable(String) unconditionally throws UnsupportedOperationException because the provider has no write access to the catalog.

Source

Thrown at sdks/java/extensions/sql/datacatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/DataCatalogTableProvider.java:99

  public static DataCatalogTableProvider create(DataCatalogPipelineOptions options) {
    return new DataCatalogTableProvider(
        createDataCatalogClient(options), options.getTruncateTimestamps());
  }

  @Override
  public String getTableType() {
    return "google.cloud.datacatalog";
  }

  @Override
  public void createTable(Table table) {
    throw new UnsupportedOperationException(
        "Creating tables is not supported with DataCatalog table provider.");
  }

  @Override
  public void dropTable(String tableName) {
    throw new UnsupportedOperationException(
        "Dropping tables is not supported with DataCatalog table provider");
  }

  @Override
  public Map<String, Table> getTables() {
    throw new UnsupportedOperationException("Loading all tables from DataCatalog is not supported");
  }

  @Override
  public @Nullable Table getTable(String tableName) {
    return loadTable(tableName);
  }

  @Override
  public Table getTableByFullName(TableName fullTableName) {

    ImmutableList<String> allNameParts =
        ImmutableList.<String>builder()

View on GitHub (pinned to 12126d8942)

Solutions

  1. Drop the table in BigQuery and remove the DataCatalog entry using the GCP console or the Data Catalog/BigQuery client APIs.
  2. Route DROP TABLE to a writable provider or skip it for datacatalog-backed tables.
  3. Guard DDL scripts so datacatalog tables are excluded from drop statements.

Example fix

// before
beamSqlEnv.executeDdl("DROP TABLE t"); // t is datacatalog-backed

// after
// drop via GCP APIs:
// bigquery.deleteTable("my-proj", "my_ds", "t"); then delete the catalog entry
Defensive patterns

Strategy: validation

Validate before calling

if ("google.cloud.datacatalog".equals(provider.getTableType())) {
  throw new IllegalStateException("dropTable is not supported; drop via BigQuery/DataCatalog APIs");
}

Try / catch

try {
  provider.dropTable(name);
} catch (UnsupportedOperationException e) {
  // perform the drop with BigQuery/DataCatalog client APIs
}

Prevention

When it happens

Trigger: Executing DROP TABLE against a BeamSqlEnv using the google.cloud.datacatalog provider, or calling provider.dropTable(name) directly.

Common situations: Cleanup steps in SQL scripts that drop temporary tables; migrations that mix writable and read-only providers.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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