apache/beam · error · UnsupportedOperationException

buildIOWriter unsupported!

Error message

buildIOWriter unsupported!

What it means

GenerateSequenceTable is a read-only virtual table: buildIOWriter — the interface hook for writing a PCollection back to the source — unconditionally throws UnsupportedOperationException. Beam SQL calls it when executing INSERT/DML against a table backed by the sequence generator.

Solutions

  1. Remove the INSERT/writing statement — seqgen tables only support reading (SELECT).
  2. Write output to a supported sink table type (text, kafka, bigquery, etc.) instead.
  3. If writing is required, implement buildIOWriter in a custom table provider.

Example fix

// before
INSERT INTO seq_table SELECT * FROM src
// after
INSERT INTO output_text_table SELECT * FROM seq_table
Defensive patterns

Strategy: validation

Validate before calling

if (tableProvider instanceof GenerateSequenceTable || "seqgen".equals(tableType)) {
  throw new UnsupportedOperationException("Sequence tables are read-only; use a different sink");
}

Try / catch

try { writer = table.buildIOWriter(input); } catch (UnsupportedOperationException e) { /* route output to a writable sink */ }

Prevention

When it happens

Trigger: Running INSERT INTO seq_table SELECT ... where seq_table is of type 'seqgen'; any pipeline attempt to write output through the GenerateSequence provider.

Common situations: Developers assuming a sequence generator table can also sink data; DML statements generated by generic SQL tooling against a read-only provider.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/seqgen/GenerateSequenceTable.java:74

  @Override
  public PCollection<Row> buildIOReader(PBegin begin) {
    return begin
        .apply(GenerateSequence.from(0).withRate(elementsPerSecond, Duration.standardSeconds(1)))
        .apply(
            MapElements.into(TypeDescriptor.of(Row.class))
                .via(elm -> Row.withSchema(TABLE_SCHEMA).addValues(elm, Instant.now()).build()))
        .setRowSchema(getSchema());
  }

  @Override
  public BeamTableStatistics getTableStatistics(PipelineOptions options) {
    return BeamTableStatistics.createUnboundedTableStatistics((double) elementsPerSecond);
  }

  @Override
  public POutput buildIOWriter(PCollection<Row> input) {
    throw new UnsupportedOperationException("buildIOWriter unsupported!");
  }
}

View on GitHub (pinned to 12126d8942)