{"record":{"id":"389f03b308046c84","repo":"apache/beam","slug":"deleting-tables-in-hcatalog-is-not-supported","errorCode":null,"errorMessage":"Deleting tables in HCatalog is not supported","messagePattern":"Deleting tables in HCatalog is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/hcatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/hcatalog/HCatalogTableProvider.java","lineNumber":74,"sourceCode":"    return new HCatalogTableProvider(\n        new HashMap<>(configuration),\n        metastoreSchema,\n        new DatabaseProvider(\"default\", metastoreSchema, configuration));\n  }\n\n  @Override\n  public String getTableType() {\n    return \"hcatalog\";\n  }\n\n  @Override\n  public void createTable(Table table) {\n    throw new UnsupportedOperationException(\"Creating tables in HCatalog is not supported\");\n  }\n\n  @Override\n  public void dropTable(String tableName) {\n    throw new UnsupportedOperationException(\"Deleting tables in HCatalog is not supported\");\n  }\n\n  @Override\n  public Map<String, Table> getTables() {\n    throw new UnsupportedOperationException(\"Extracting all tables from HCatalog is not supported\");\n  }\n\n  @Nullable\n  @Override\n  public Table getTable(String name) {\n    // Tables should have been looked up from sub-providers.\n    // If we reached this then getSubProvider(name) returned null\n    // meaning there's no such DB. Try to look up the table in the default DB instead.\n    return defaultDBProvider.getTable(name);\n  }\n\n  @Override\n  public BeamSqlTable buildBeamSqlTable(Table table) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/hcatalog/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/hcatalog/HCatalogTableProvider.java#L56-L92","documentation":"HCatalogTableProvider.dropTable unconditionally throws to signal that this provider performs no metastore DDL: creating and deleting tables through the Beam SQL HCatalog provider is not implemented. The dropTable invocation itself is the rejected operation; manage Hive tables directly via the metastore instead.","triggerScenarios":"Calling dropTable(tableName) on HCatalogTableProvider (e.g. DROP TABLE DDL or generic provider teardown).","commonSituations":"Cleanup/teardown utilities calling dropTable generically across providers; DROP TABLE statements in Beam SQL against hcatalog.","solutions":["Drop tables via Hive DDL or HCatClient outside Beam.","Wrap best-effort drops in try-catch for UnsupportedOperationException.","Skip dropTable calls when provider.getTableType().equals(\"hcatalog\")."],"exampleFix":"// before\nprovider.dropTable(\"tbl\");\n// after\nif (!\"hcatalog\".equals(provider.getTableType())) {\n  provider.dropTable(\"tbl\");\n} else {\n  hcatClient.dropTable(db, \"tbl\", true, false);\n}","handlingStrategy":"try-catch","validationCode":"if (provider instanceof HCatalogTableProvider && droppingTables) {\n  throw new IllegalArgumentException(\"Drop tables via Hive client, not Beam SQL\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  provider.dropTable(name);\n} catch (UnsupportedOperationException e) {\n  hcatClient.dropTable(db, name, true, false);\n}","preventionTips":["Handle table drops outside Beam for hcatalog catalogs.","Make generic teardown code tolerant of UnsupportedOperationException.","Prefer explicit metastore clients for lifecycle operations."],"tags":["java","beam-sql","hcatalog","ddl"],"backgroundTag":"operation-not-supported","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"}