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
- Avoid code paths that rely on getOperandList() for CREATE EXTERNAL TABLE nodes; access the dedicated getters (getTableName, schema, location, tblProperties) instead
- If a Calcite pass trips on it, register/pass the DDL node outside that pass or handle SqlCreateExternalTable specially in the visitor
- 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
- Do not run Calcite passes/tools that generically call getOperandList() over DDL nodes
- Access CREATE EXTERNAL TABLE metadata via getTableName()/schema/location/tblProperties getters
- Handle SqlCreateExternalTable explicitly in any SqlVisitor implementation
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
- Attempting to alter catalog
- Attempting to create a table with unexpected Calcite Schema…
- Attempting to create catalog
- Attempting to create database
- Attempting to create database
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)