{"record":{"id":"663d5f6010a2d262","repo":"apache/beam","slug":"rexnode-not-supported","errorCode":null,"errorMessage":"RexNode not supported: ","messagePattern":"RexNode not supported: ","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/cep/CEPCall.java","lineNumber":68,"sourceCode":"  public static CEPCall of(RexCall operation) {\n    SqlOperator call = operation.getOperator();\n    CEPOperator myOp = CEPOperator.of(call);\n\n    ArrayList<CEPOperation> operandsList = new ArrayList<>();\n    for (RexNode i : operation.getOperands()) {\n      if (i.getClass() == RexCall.class) {\n        CEPCall callToAdd = CEPCall.of((RexCall) i);\n        operandsList.add(callToAdd);\n      } else if (i.getClass() == RexLiteral.class) {\n        RexLiteral lit = (RexLiteral) i;\n        CEPLiteral litToAdd = CEPLiteral.of(lit);\n        operandsList.add(litToAdd);\n      } else if (i.getClass() == RexPatternFieldRef.class) {\n        RexPatternFieldRef fieldRef = (RexPatternFieldRef) i;\n        CEPFieldRef fieldRefToAdd = CEPFieldRef.of(fieldRef);\n        operandsList.add(fieldRefToAdd);\n      } else {\n        throw new UnsupportedOperationException(\"RexNode not supported: \" + i.getClass().getName());\n      }\n    }\n\n    return new CEPCall(myOp, operandsList);\n  }\n\n  @Override\n  public String toString() {\n    ArrayList<String> operandStrings = new ArrayList<>();\n    for (CEPOperation i : operands) {\n      operandStrings.add(i.toString());\n    }\n    return operator.toString() + \"(\" + String.join(\", \", operandStrings) + \")\";\n  }\n}\n","sourceCodeStart":50,"sourceCodeEnd":84,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/cep/CEPCall.java#L50-L84","documentation":"When translating a Calcite MATCH_RECOGNIZE (CEP) pattern, CEPCall.of converts each RexNode operand of a call; only RexLiteral and RexPatternFieldRef operands are supported. Any other RexNode subtype (e.g. a nested RexCall, RexInputRef) hits the else branch and throws UnsupportedOperationException naming the operand class.","triggerScenarios":"Using a MATCH_RECOGNIZE pattern whose DEFINE/PARAMETER expressions contain nested function calls or unsupported RexNode operands instead of plain literals and pattern field references.","commonSituations":"Writing complex CEP DEFINE clauses with arithmetic or nested SQL function calls that Beam SQL's CEP translator does not yet support; porting standard SQL MATCH_RECOGNIZE queries that use richer expressions.","solutions":["Rewrite the pattern expression so operands are only literals and pattern field references (RexPatternFieldRef)","Pre-compute nested expressions outside the MATCH_RECOGNIZE clause (e.g. in a subquery/projection) and reference them as fields","Check the operand class reported in the message and file a/look for a Beam JIRA to add support for that RexNode type"],"exampleFix":"// before\nDEFINE x AS price * qty > 100  -- nested RexCall operand\n// after\nSELECT * FROM (SELECT *, price * qty AS amount FROM t) MATCH_RECOGNIZE (... DEFINE x AS amount > 100 ...)","handlingStrategy":"validation","validationCode":"for (RexNode op : call.getOperands()) {\n  if (!(op instanceof RexLiteral) && !(op instanceof RexPatternFieldRef))\n    throw new IllegalArgumentException(\"Unsupported CEP operand: \" + op.getClass().getSimpleName());\n}","typeGuard":"static boolean isCepSupportedOperand(RexNode n) {\n  return n instanceof RexLiteral || n instanceof RexPatternFieldRef;\n}","tryCatchPattern":"try {\n  CEPCall c = CEPCall.of(op, operands);\n} catch (UnsupportedOperationException e) {\n  if (e.getMessage().startsWith(\"RexNode not supported\")) {\n    throw new IllegalStateException(\"Simplify MATCH_RECOGNIZE expression: \" + e.getMessage(), e);\n  } else throw e;\n}","preventionTips":["Keep DEFINE expressions to literals and pattern field references only","Hoist complex arithmetic into projections before MATCH_RECOGNIZE","Review Beam SQL CEP docs/JIRAs for supported RexNode types before writing advanced patterns"],"tags":["beam-sql","cep","calcite","unsupported-operation","rexnode"],"backgroundTag":"unsupported-operation","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"}