{"record":{"id":"411e5575b8c96778","repo":"apache/beam","slug":"the-function-is-not-supported-for-now-cepkind","errorCode":null,"errorMessage":"the function is not supported for now: ${cepKind}","messagePattern":"the function is not supported for now: (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/nfa/NFA.java","lineNumber":522,"sourceCode":"    private CEPLiteral evalLeftSideCondition(CEPOperation inputOperation, Event inputEvent) {\n      if (inputOperation instanceof CEPLiteral) {\n        return (CEPLiteral) inputOperation;\n      } else if (inputOperation.getClass() == CEPFieldRef.class) {\n        return inputEvent.toCEPLiteral((CEPFieldRef) inputOperation);\n      } else if (inputOperation.getClass() == CEPCall.class) {\n        CEPCall call = (CEPCall) inputOperation;\n        CEPOperator operator = call.getOperator();\n        List<CEPOperation> operands = call.getOperands();\n        switch (operator.getCepKind()) {\n          case LAST:\n            return last(\n                operands.get(0), evalLeftSideCondition(operands.get(1), inputEvent), inputEvent);\n          case PLUS:\n            return plus(\n                evalLeftSideCondition(operands.get(0), inputEvent),\n                evalLeftSideCondition(operands.get(1), inputEvent));\n          default:\n            throw new UnsupportedOperationException(\n                \"the function is not supported for now: \" + operator.getCepKind().toString());\n        }\n      } else {\n        throw new IllegalStateException(\n            \"the left side CEP operation is not legal: \" + inputOperation.getClass().toString());\n      }\n    }\n\n    // evaluates the condition value (right) given an input event\n    private CEPLiteral evalRightSideCondition(CEPOperation inputOperation, Event inputEvent) {\n      if (inputOperation instanceof CEPLiteral) {\n        return (CEPLiteral) inputOperation;\n      } else if (inputOperation.getClass() == CEPCall.class) {\n        CEPCall call = (CEPCall) inputOperation;\n        CEPOperator operator = call.getOperator();\n        List<CEPOperation> operands = call.getOperands();\n        switch (operator.getCepKind()) {\n          case PLUS:","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/nfa/NFA.java#L504-L540","documentation":"NFA.evalLeftSideCondition evaluates the left operand of a comparison by recursively reducing CEPOperator calls (e.g. CLASS, PREV, PLUS). Only a fixed set of CepKinds is handled; any other operator kind (PLUS intervals, EXTRACT, etc. not implemented) throws UnsupportedOperationException naming the CepKind.","triggerScenarios":"A DEFINE left-side expression using an arithmetic/logical operator whose CepKind is absent from the switch (e.g. MINUS, DIVIDE, TIMES, EXTRACT) in a MATCH_RECOGNIZE query.","commonSituations":"Writing conditions like A.price - A.cost > 0 or division/comparison of computed expressions that the CEP layer does not yet support.","solutions":["Rewrite the condition so the left side only uses supported functions (field access, PREV, supported arithmetic).","Precompute the expression as a new schema field upstream and compare that field in DEFINE.","Extend evalLeftSideCondition with a case for the missing CepKind (mirroring the plus() helper).","Symmetrically check evalRightSideCondition — the same operator must be supported on the side where it appears."],"exampleFix":"// before\nDEFINE A AS A.price - A.cost > 0\n// after (upstream field)\n.addField(\"margin\", FieldType.DOUBLE) // price - cost\n// DEFINE A AS A.margin > 0","handlingStrategy":"validation","validationCode":"// Check the left-side CepKind before building the query\nif (!SUPPORTED_LEFT_KINDS.contains(cepKind)) {\n  throw new IllegalArgumentException(\"Left-side operator not supported by CEP: \" + cepKind);\n}","typeGuard":"boolean isSupportedLeftOp(CEPOperation op) { return op instanceof CEPOperator && SUPPORTED_LEFT_KINDS.contains(((CEPOperator) op).getCepKind()); }","tryCatchPattern":"try { return evalLeftSideCondition(op, event); } catch (UnsupportedOperationException e) { throw new QueryValidationException(\"Unsupported operator in DEFINE left side\", e); }","preventionTips":["Restrict left-side expressions to field access, PREV, and PLUS.","Precompute arithmetic into schema fields upstream.","Check the CEP feature matrix for your Beam version before writing complex DEFINE expressions."],"tags":["java","nfa","cep","operator","unsupported"],"backgroundTag":"operation-not-supported","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}