{"record":{"id":"65630887bc6e8cde","repo":"apache/skywalking","slug":"unsupported-operation","errorCode":null,"errorMessage":"Unsupported operation.","messagePattern":"Unsupported operation\\.","errorType":"exception","errorClass":"IllegalExpressionException","httpStatus":null,"severity":"error","filePath":"oap-server/mqe-rt/src/main/java/org/apache/skywalking/mqe/rt/operation/LROp.java","lineNumber":57,"sourceCode":"                                          ExpressionResult right,\n                                          int opType, LROp calculate) throws IllegalExpressionException {\n        if (left.getType() == ExpressionResultType.SINGLE_VALUE && right.getType() == ExpressionResultType.SINGLE_VALUE) {\n            return single2SingleBinaryOp(left, right, opType, calculate);\n        } else if ((left.getType() == ExpressionResultType.TIME_SERIES_VALUES ||\n            left.getType() == ExpressionResultType.SORTED_LIST ||\n            left.getType() == ExpressionResultType.RECORD_LIST)\n            && right.getType() == ExpressionResultType.SINGLE_VALUE) {\n            return many2OneBinaryOp(left, right, opType, calculate);\n        } else if (left.getType() == ExpressionResultType.SINGLE_VALUE &&\n            (right.getType() == ExpressionResultType.TIME_SERIES_VALUES ||\n                right.getType() == ExpressionResultType.SORTED_LIST ||\n                right.getType() == ExpressionResultType.RECORD_LIST)) {\n            return one2ManyBinaryOp(left, right, opType, calculate);\n        } else if (left.getType() == ExpressionResultType.TIME_SERIES_VALUES && right.getType() == ExpressionResultType.TIME_SERIES_VALUES) {\n            return seriesBinaryOp(left, right, opType, calculate);\n        }\n\n        throw new IllegalExpressionException(\"Unsupported operation.\");\n    }\n\n    //series with series\n    private static ExpressionResult seriesBinaryOp(ExpressionResult seriesLeft,\n                                                   ExpressionResult seriesRight,\n                                                   int opType, LROp calculate) throws IllegalExpressionException {\n        ExpressionResult result = new ExpressionResult();\n        if (!seriesLeft.isLabeledResult() && !seriesRight.isLabeledResult()) { // no labeled with no labeled\n            result = seriesNoLabeled(seriesLeft, seriesRight, opType, calculate);\n        } else if (seriesLeft.isLabeledResult() && !seriesRight.isLabeledResult()) { // labeled with no labeled\n            result = seriesLabeledWithNoLabeled(seriesLeft, seriesRight, opType, calculate);\n        } else if (!seriesLeft.isLabeledResult() && seriesRight.isLabeledResult()) { // no labeled with labeled\n            result = seriesNoLabeledWithLabeled(seriesLeft, seriesRight, opType, calculate);\n        } else { // labeled with labeled\n            result = seriesLabeledWithLabeled(seriesLeft, seriesRight, opType, calculate);\n        }\n\n        return result;","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/mqe-rt/src/main/java/org/apache/skywalking/mqe/rt/operation/LROp.java#L39-L75","documentation":"The core IllegalExpressionException from LROp.doLROp's type dispatch: the left/right ExpressionResultType combination matches none of the supported branches — SINGLE_VALUE×SINGLE_VALUE (scalar path, handled earlier), many(TIME_SERIES/SORTED_LIST/RECORD_LIST)×SINGLE, SINGLE×many, or TIME_SERIES×TIME_SERIES. This is the root cause message that BinaryOp, CompareOp and BoolOp re-wrap in their 'Unsupported X operation' errors.","triggerScenarios":"Any MQE binary operation between two 'many' operands where at least one is not a time series: LIST×LIST, RECORD_LIST×SERIES, SORTED_LIST×RECORD_LIST, SINGLE×SINGLE arriving on the non-scalar path, etc. Example: 'topn(a,10) + topn(b,10)', 'queryLogs(...) > metric'.","commonSituations":"Combining two TopN results; mixing record queries (traces/logs) with metric arithmetic; combining labeled series under unsupported label-pairing branches; building complex dashboard expressions without checking each intermediate's result type.","solutions":["Identify both operand types (UI shows the result type of each sub-expression, or consult the MQE docs) and reshape so the pair is series×series, or one side a single value","Apply aggregations to reduce lists to series before combining: aggregate_labels(x, SUM), or restructure so topn/records sit outside the arithmetic","Compare/boolean operators additionally require boolean leaves — see the BoolOp-specific errors","Simplify the expression into stages and verify each stage renders alone in the UI before combining"],"exampleFix":"# before\ntopn(service_cpm.sum(dt5m), 10, DES) + topn(service_sla.sum(dt5m), 10, DES)\n# after\n(service_cpm.sum(dt5m) + service_sla.sum(dt5m))  # arithmetic on series; apply topn afterwards if needed","handlingStrategy":"type-guard","validationCode":"boolean isLROpSupported(ExpressionResultType l, ExpressionResultType r) {\n    boolean manyL = l == TIME_SERIES_VALUES || l == SORTED_LIST || l == RECORD_LIST;\n    boolean manyR = r == TIME_SERIES_VALUES || r == SORTED_LIST || r == RECORD_LIST;\n    return (l == SINGLE_VALUE && r == SINGLE_VALUE)\n        || (manyL && r == SINGLE_VALUE) || (l == SINGLE_VALUE && manyR)\n        || (l == TIME_SERIES_VALUES && r == TIME_SERIES_VALUES);\n}","typeGuard":"boolean isBinaryOperandType(org.apache.skywalking.oap.server.core.query.mqe.ExpressionResultType t) {\n    return t == org.apache.skywalking.oap.server.core.query.mqe.ExpressionResultType.SINGLE_VALUE\n        || t == org.apache.skywalking.oap.server.core.query.mqe.ExpressionResultType.TIME_SERIES_VALUES;\n}","tryCatchPattern":"catch (IllegalExpressionException e) { /* reshape: aggregate lists to series, or move topn/records outside the binary op */ }","preventionTips":["Build MQE expressions incrementally and check each intermediate's type","Reduce SORTED_LIST/RECORD_LIST with aggregations before any binary operator","Keep topn() and record queries at the outermost level only"],"tags":["mqe","type-mismatch","binary-op","query","unsupported-operation"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}