apache/beam · error · UnsupportedOperationException

Cannot write to SHOW TABLES

Error message

Cannot write to SHOW TABLES

What it means

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.

Solutions

  1. Query SHOW TABLES read-only; do not issue INSERT/UPDATE against it.
  2. Create or drop actual tables through the table provider (CREATE TABLE / DROP TABLE) instead.
Defensive patterns

Strategy: validation

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/9dce5446703a971c. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/SystemTables.java:169

      this.dbName = dbName;
    }

    @Override
    public PCollection<Row> buildIOReader(PBegin begin) {
      // Note: This captures the state *at the moment of planning*
      List<Row> rows =
          catalog.metaStore(dbName).getTables().values().stream()
              .map(
                  table ->
                      Row.withSchema(SCHEMA).addValues(table.getName(), table.getType()).build())
              .collect(Collectors.toList());

      return begin.apply(Create.of(rows).withRowSchema(SCHEMA));
    }

    @Override
    public POutput buildIOWriter(PCollection<Row> input) {
      throw new UnsupportedOperationException("Cannot write to SHOW TABLES");
    }

    @Override
    public PCollection.IsBounded isBounded() {
      return PCollection.IsBounded.BOUNDED;
    }

    @Override
    public Schema getSchema() {
      return SCHEMA;
    }
  }
}

View on GitHub (pinned to 12126d8942)