{"record":{"id":"c87a7c4fc1c0f4ba","repo":"apache/beam","slug":"getting-operands-create-table-is-unsupported-at-the-moment","errorCode":null,"errorMessage":"Getting operands CREATE TABLE is unsupported at the moment","messagePattern":"Getting operands CREATE TABLE is unsupported at the moment","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/parser/SqlCreateExternalTable.java","lineNumber":93,"sourceCode":"      List<Field> columnList,\n      SqlNode type,\n      SqlNodeList partitionFields,\n      SqlNode comment,\n      SqlNode location,\n      SqlNode tblProperties) {\n    super(OPERATOR, pos, replace, ifNotExists);\n    this.name = checkNotNull(name);\n    this.columnList = columnList; // may be null\n    this.type = checkNotNull(type);\n    this.partitionFields = partitionFields;\n    this.comment = comment; // may be null\n    this.location = location; // may be null\n    this.tblProperties = tblProperties; // may be null\n  }\n\n  @Override\n  public List<SqlNode> getOperandList() {\n    throw new UnsupportedOperationException(\n        \"Getting operands CREATE TABLE is unsupported at the moment\");\n  }\n\n  @Override\n  public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {\n    writer.keyword(\"CREATE\");\n    writer.keyword(\"EXTERNAL\");\n    writer.keyword(\"TABLE\");\n    if (ifNotExists) {\n      writer.keyword(\"IF NOT EXISTS\");\n    }\n    name.unparse(writer, leftPrec, rightPrec);\n\n    if (columnList != null) {\n      SqlWriter.Frame frame = writer.startList(\"(\", \")\");\n      columnList.forEach(column -> unparseColumn(writer, column));\n      writer.endList(frame);\n    }","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/parser/SqlCreateExternalTable.java#L75-L111","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  calcitePass.visit(parseNode);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().contains(\"Getting operands CREATE TABLE is unsupported\")) {\n    // skip generic operand traversal; use SqlCreateExternalTable's dedicated getters\n  } else throw e;\n}","preventionTips":["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"],"tags":["sql","calcite","ddl","not-implemented"],"backgroundTag":"method-not-implemented","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}