{"record":{"id":"a1ad0e735c437377","repo":"apache/beam","slug":"dropping-tables-is-not-supported-with-datacatalog-table","errorCode":null,"errorMessage":"Dropping tables is not supported with DataCatalog table provider","messagePattern":"Dropping tables is not supported with DataCatalog table provider","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/datacatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/DataCatalogTableProvider.java","lineNumber":99,"sourceCode":"  public static DataCatalogTableProvider create(DataCatalogPipelineOptions options) {\n    return new DataCatalogTableProvider(\n        createDataCatalogClient(options), options.getTruncateTimestamps());\n  }\n\n  @Override\n  public String getTableType() {\n    return \"google.cloud.datacatalog\";\n  }\n\n  @Override\n  public void createTable(Table table) {\n    throw new UnsupportedOperationException(\n        \"Creating tables is not supported with DataCatalog table provider.\");\n  }\n\n  @Override\n  public void dropTable(String tableName) {\n    throw new UnsupportedOperationException(\n        \"Dropping tables is not supported with DataCatalog table provider\");\n  }\n\n  @Override\n  public Map<String, Table> getTables() {\n    throw new UnsupportedOperationException(\"Loading all tables from DataCatalog is not supported\");\n  }\n\n  @Override\n  public @Nullable Table getTable(String tableName) {\n    return loadTable(tableName);\n  }\n\n  @Override\n  public Table getTableByFullName(TableName fullTableName) {\n\n    ImmutableList<String> allNameParts =\n        ImmutableList.<String>builder()","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/datacatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datacatalog/DataCatalogTableProvider.java#L81-L117","documentation":"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.","triggerScenarios":"Executing DROP TABLE against a BeamSqlEnv using the google.cloud.datacatalog provider, or calling provider.dropTable(name) directly.","commonSituations":"Cleanup steps in SQL scripts that drop temporary tables; migrations that mix writable and read-only providers.","solutions":["Drop the table in BigQuery and remove the DataCatalog entry using the GCP console or the Data Catalog/BigQuery client APIs.","Route DROP TABLE to a writable provider or skip it for datacatalog-backed tables.","Guard DDL scripts so datacatalog tables are excluded from drop statements."],"exampleFix":"// before\nbeamSqlEnv.executeDdl(\"DROP TABLE t\"); // t is datacatalog-backed\n\n// after\n// drop via GCP APIs:\n// bigquery.deleteTable(\"my-proj\", \"my_ds\", \"t\"); then delete the catalog entry","handlingStrategy":"validation","validationCode":"if (\"google.cloud.datacatalog\".equals(provider.getTableType())) {\n  throw new IllegalStateException(\"dropTable is not supported; drop via BigQuery/DataCatalog APIs\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  provider.dropTable(name);\n} catch (UnsupportedOperationException e) {\n  // perform the drop with BigQuery/DataCatalog client APIs\n}","preventionTips":["Exclude datacatalog-backed tables from DROP TABLE scripts","Use GCP console/client APIs for table lifecycle management","Check getTableType() before issuing DDL"],"tags":["apache-beam","datacatalog","sql","java"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}