apache/beam · error · UnsupportedOperationException

ReadOnlyTableProvider does not support table creation

Error message

ReadOnlyTableProvider does not support table creation

What it means

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.

Solutions

  1. Issue CREATE TABLE only against writable providers; treat ReadOnlyTableProvider as query-only.
  2. Pre-register the needed tables in the underlying table map when constructing the provider.
  3. Route DDL statements to a different, mutable TableProvider.
Defensive patterns

Strategy: validation

When it happens

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

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/ReadOnlyTableProvider.java:48

 * BeamSqlTables}.
 */
public class ReadOnlyTableProvider implements TableProvider {
  private final String typeName;
  private final Map<String, BeamSqlTable> tables;

  public ReadOnlyTableProvider(String typeName, Map<String, BeamSqlTable> tables) {
    this.typeName = typeName;
    this.tables = tables;
  }

  @Override
  public String getTableType() {
    return typeName;
  }

  @Override
  public void createTable(Table table) {
    throw new UnsupportedOperationException(
        "ReadOnlyTableProvider does not support table creation");
  }

  @Override
  public void dropTable(String tableName) {
    throw new UnsupportedOperationException(
        "ReadOnlyTableProvider does not support table deletion");
  }

  @Override
  public Map<String, Table> getTables() {
    ImmutableMap.Builder<String, Table> map = ImmutableMap.builder();
    for (Map.Entry<String, BeamSqlTable> table : tables.entrySet()) {
      map.put(
          table.getKey(),
          Table.builder()
              .type(getTableType())
              .name(table.getKey())

View on GitHub (pinned to 12126d8942)