{"record":{"id":"cb462666f2c654f7","repo":"apache/beam","slug":"loading-all-tables-from-datacatalog-is-not-supported","errorCode":null,"errorMessage":"Loading all tables from DataCatalog is not supported","messagePattern":"Loading all tables from DataCatalog is not supported","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":105,"sourceCode":"  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()\n            .addAll(fullTableName.getPath())\n            .add(fullTableName.getTableName())\n            .build();\n\n    String fullEscapedTableName = ZetaSqlIdUtils.escapeAndJoin(allNameParts);\n","sourceCodeStart":87,"sourceCodeEnd":123,"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#L87-L123","documentation":"getTables() must enumerate every table the provider serves, but DataCatalog has no cheap bulk listing that maps to this contract, so the provider throws UnsupportedOperationException. Only point lookups via getTable(tableName) are supported.","triggerScenarios":"Calling provider.getTables() directly, or operations that need the full table list: metadata queries against the catalog, Calcite schema enumeration, or tools listing all available Beam SQL tables.","commonSituations":"Schema-browsing tools, dashboards that list tables, or test harnesses that call getTables() to validate provider contents.","solutions":["Use getTable(name) / the SQL `SELECT` against a known table name instead of enumerating.","List DataCatalog entries with the DataCatalog search/lookup APIs directly and look them up individually.","Avoid operations that require full-table enumeration against this provider."],"exampleFix":"// before\nMap<String, Table> all = provider.getTables(); // throws\n\n// after\nTable t = provider.getTable(\"project:dataset.table\");\nif (t != null) { /* use t */ }","handlingStrategy":"try-catch","validationCode":"if (\"google.cloud.datacatalog\".equals(provider.getTableType()) && needFullListing) {\n  throw new IllegalStateException(\"getTables unsupported; use getTable(name)\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  provider.getTables();\n} catch (UnsupportedOperationException e) {\n  // enumerate via DataCatalog search API or use known table names\n}","preventionTips":["Never rely on full table enumeration for this provider","Use getTable(name) with known names","List entries with DataCatalog search/lookup APIs outside Beam if enumeration is needed"],"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"}