{"record":{"id":"d57b31c63f911171","repo":"apache/beam","slug":"readonlytableprovider-does-not-support-table-creation","errorCode":null,"errorMessage":"ReadOnlyTableProvider does not support table creation","messagePattern":"ReadOnlyTableProvider does not support table creation","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/ReadOnlyTableProvider.java","lineNumber":48,"sourceCode":" * BeamSqlTables}.\n */\npublic class ReadOnlyTableProvider implements TableProvider {\n  private final String typeName;\n  private final Map<String, BeamSqlTable> tables;\n\n  public ReadOnlyTableProvider(String typeName, Map<String, BeamSqlTable> tables) {\n    this.typeName = typeName;\n    this.tables = tables;\n  }\n\n  @Override\n  public String getTableType() {\n    return typeName;\n  }\n\n  @Override\n  public void createTable(Table table) {\n    throw new UnsupportedOperationException(\n        \"ReadOnlyTableProvider does not support table creation\");\n  }\n\n  @Override\n  public void dropTable(String tableName) {\n    throw new UnsupportedOperationException(\n        \"ReadOnlyTableProvider does not support table deletion\");\n  }\n\n  @Override\n  public Map<String, Table> getTables() {\n    ImmutableMap.Builder<String, Table> map = ImmutableMap.builder();\n    for (Map.Entry<String, BeamSqlTable> table : tables.entrySet()) {\n      map.put(\n          table.getKey(),\n          Table.builder()\n              .type(getTableType())\n              .name(table.getKey())","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/ReadOnlyTableProvider.java#L30-L66","documentation":"ReadOnlyTableProvider wraps a fixed, in-memory map of BeamSqlTables for read-only query access. createTable is a hardcoded guard: this provider has no backing store for DDL, so any CREATE TABLE against it always throws UnsupportedOperationException.","triggerScenarios":"Thrown at sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/ReadOnlyTableProvider.java:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Issue CREATE TABLE only against writable providers; treat ReadOnlyTableProvider as query-only.","Pre-register the needed tables in the underlying table map when constructing the provider.","Route DDL statements to a different, mutable TableProvider."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}