{"record":{"id":"9dce5446703a971c","repo":"apache/beam","slug":"cannot-write-to-show-tables","errorCode":null,"errorMessage":"Cannot write to SHOW TABLES","messagePattern":"Cannot write to SHOW TABLES","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/SystemTables.java","lineNumber":169,"sourceCode":"      this.dbName = dbName;\n    }\n\n    @Override\n    public PCollection<Row> buildIOReader(PBegin begin) {\n      // Note: This captures the state *at the moment of planning*\n      List<Row> rows =\n          catalog.metaStore(dbName).getTables().values().stream()\n              .map(\n                  table ->\n                      Row.withSchema(SCHEMA).addValues(table.getName(), table.getType()).build())\n              .collect(Collectors.toList());\n\n      return begin.apply(Create.of(rows).withRowSchema(SCHEMA));\n    }\n\n    @Override\n    public POutput buildIOWriter(PCollection<Row> input) {\n      throw new UnsupportedOperationException(\"Cannot write to SHOW TABLES\");\n    }\n\n    @Override\n    public PCollection.IsBounded isBounded() {\n      return PCollection.IsBounded.BOUNDED;\n    }\n\n    @Override\n    public Schema getSchema() {\n      return SCHEMA;\n    }\n  }\n}\n","sourceCodeStart":151,"sourceCodeEnd":183,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/SystemTables.java#L151-L183","documentation":"Thrown unconditionally by the SystemTable's buildIOWriter override: the SHOW TABLES metadata source is read-only by design (it materializes catalog table rows during planning in buildIOReader), so no sink/write path exists. Any pipeline that attempts to write output into a SystemTables-backed table (e.g., inserting rows into a SHOW TABLES catalog view) triggers this at construction of the write transform, before the pipeline runs.","triggerScenarios":"Thrown at sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/SystemTables.java:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Query SHOW TABLES read-only; do not issue INSERT/UPDATE against it.","Create or drop actual tables through the table provider (CREATE TABLE / DROP TABLE) instead."],"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"}