apache/beam · error · UnsupportedOperationException

Getting operands CREATE TABLE is unsupported at the moment

Error message

Getting operands CREATE TABLE is unsupported at the moment

What it means

SqlCreateExternalTable overrides Calcite's SqlNode.getOperandList(), which the framework may call for generic node handling (rewriting, validation, unparsing of operands). Since CREATE EXTERNAL TABLE operands are managed through dedicated fields (table name, schema, location, properties), returning the generic list is not implemented, so it throws UnsupportedOperationException unconditionally.

Solutions

  1. Avoid code paths that rely on getOperandList() for CREATE EXTERNAL TABLE nodes; access the dedicated getters (getTableName, schema, location, tblProperties) instead
  2. If a Calcite pass trips on it, register/pass the DDL node outside that pass or handle SqlCreateExternalTable specially in the visitor
  3. Patch/override getOperandList() to return the actual operands if you control the Beam fork
Defensive patterns

Strategy: try-catch

Try / catch

try {
  calcitePass.visit(parseNode);
} catch (UnsupportedOperationException e) {
  if (e.getMessage().contains("Getting operands CREATE TABLE is unsupported")) {
    // skip generic operand traversal; use SqlCreateExternalTable's dedicated getters
  } else throw e;
}

Prevention

When it happens

Trigger: Any framework path that calls getOperandList() on a CREATE EXTERNAL TABLE parse node — e.g. Calcite's SqlShuttle visitor, some validator/rewriter passes, or tools that introspect the parse tree generically.

Common situations: Running the query through a Calcite optimizer rule or third-party tool that walks operand lists of all parse nodes; calling getOperandList() directly when post-processing parsed DDL.

Related errors


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

Appendix: source

Thrown at sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/parser/SqlCreateExternalTable.java:93

      List<Field> columnList,
      SqlNode type,
      SqlNodeList partitionFields,
      SqlNode comment,
      SqlNode location,
      SqlNode tblProperties) {
    super(OPERATOR, pos, replace, ifNotExists);
    this.name = checkNotNull(name);
    this.columnList = columnList; // may be null
    this.type = checkNotNull(type);
    this.partitionFields = partitionFields;
    this.comment = comment; // may be null
    this.location = location; // may be null
    this.tblProperties = tblProperties; // may be null
  }

  @Override
  public List<SqlNode> getOperandList() {
    throw new UnsupportedOperationException(
        "Getting operands CREATE TABLE is unsupported at the moment");
  }

  @Override
  public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {
    writer.keyword("CREATE");
    writer.keyword("EXTERNAL");
    writer.keyword("TABLE");
    if (ifNotExists) {
      writer.keyword("IF NOT EXISTS");
    }
    name.unparse(writer, leftPrec, rightPrec);

    if (columnList != null) {
      SqlWriter.Frame frame = writer.startList("(", ")");
      columnList.forEach(column -> unparseColumn(writer, column));
      writer.endList(frame);
    }

View on GitHub (pinned to 12126d8942)