{"record":{"id":"050d29811991bc43","repo":"apache/skywalking","slug":"unsupported-bool-operation","errorCode":null,"errorMessage":"Unsupported bool operation: {}","messagePattern":"Unsupported bool operation: (.+?)","errorType":"exception","errorClass":"IllegalExpressionException","httpStatus":null,"severity":"error","filePath":"oap-server/mqe-rt/src/main/java/org/apache/skywalking/mqe/rt/operation/BoolOp.java","lineNumber":42,"sourceCode":"\npublic class BoolOp {\n    public static ExpressionResult doBoolOp(ExpressionResult left,\n                                            ExpressionResult right,\n                                            int opType) throws IllegalExpressionException {\n        if (!checkExpression(left)) {\n            throw new IllegalExpressionException(\n                \"Bool Operation: The result of the left expression is not a compare result.\");\n        }\n\n        if (!checkExpression(right)) {\n            throw new IllegalExpressionException(\n                \"Bool Operation: The result of the right expression is not a compare result.\");\n        }\n\n        try {\n            return LROp.doLROp(left, right, opType, BoolOp::boolOp);\n        } catch (IllegalExpressionException e) {\n            throw new IllegalExpressionException(\"Unsupported bool operation: \" + e.getMessage());\n        }\n    }\n\n    //bool with bool\n    private static double boolOp(double leftValue, double rightValue, int opType) throws IllegalExpressionException {\n        // this should not happen, but just in case\n        if (!checkBool(leftValue)) {\n            throw new IllegalExpressionException(\"Bool Operation: The result of the left expression is not 1 or 0.\");\n        }\n        if (!checkBool(rightValue)) {\n            throw new IllegalExpressionException(\"Bool Operation: The result of the right expression is not 1 or 0.\");\n        }\n        switch (opType) {\n            case MQEParser.AND:\n                if (leftValue == 1 && rightValue == 1) {\n                    return 1;\n                } else {\n                    return 0;","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/mqe-rt/src/main/java/org/apache/skywalking/mqe/rt/operation/BoolOp.java#L24-L60","documentation":"IllegalExpressionException from BoolOp.doBoolOp wrapping the cause of a failed LROp.doLROp call for boolean connectors. The message chain is 'Unsupported bool operation: <cause>' — the cause is either LROp's type-mismatch rejection ('Unsupported operation.') because the two boolean sub-results have incompatible result shapes, or a scalar-level boolOp failure.","triggerScenarios":"&& / || between boolean results whose ExpressionResultTypes don't combine under LROp's matrix (e.g. a boolean time-series compared with a boolean SORTED_LIST, or labeled vs non-labeled boolean series where pairing fails).","commonSituations":"Boolean expressions over mixed operand shapes: comparing a TopN-filtered boolean against a series boolean; combining a trend boolean with a scalar boolean produced by aggregation; labeled boolean series whose label sets don't align.","solutions":["Unwrap the cause message to see whether it is a type mismatch or a 1/0 violation, then address that underlying condition","Make both sides of && / || the same result shape (both plain time-series booleans is the safe case)","Reduce labeled results with aggregate_labels before comparing, so both operands are unlabeled booleans","Test each comparison leaf alone in the UI, then combine them only when both render as series"],"exampleFix":"# before\n(topn(...) > 10) && (service_cpm > 5)\n# after\n(aggregate_labels(service_cpm, SUM) > 10) && (service_cpm > 5)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (IllegalExpressionException e) { /* message = 'Unsupported bool operation: <cause>'; fix the shape mismatch described by <cause> */ }","preventionTips":["Make both sides of && / || unlabeled time-series booleans","Aggregate labeled results before comparing","Test each comparison leaf alone before combining"],"tags":["mqe","boolean","type-mismatch","query","unsupported-operation"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}