{"record":{"id":"34f02588793b6afe","repo":"apache/skywalking","slug":"unsupported-string-operator","errorCode":null,"errorMessage":"Unsupported string operator: {}","messagePattern":"Unsupported string operator: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/v2/generator/MetricDefinitionEnricher.java","lineNumber":482,"sourceCode":"            return op == FilterOperator.EQUAL ? \"booleanMatch\" : \"booleanNotEqualMatch\";\n        } else if (value.isNumber()) {\n            switch (op) {\n                case EQUAL: return \"numberMatch\";\n                case NOT_EQUAL: return \"notEqualMatch\";\n                case GREATER: return \"greaterMatch\";\n                case LESS: return \"lessMatch\";\n                case GREATER_EQUAL: return \"greaterEqualMatch\";\n                case LESS_EQUAL: return \"lessEqualMatch\";\n                default: throw new IllegalArgumentException(\"Unsupported number operator: \" + op);\n            }\n        } else if (value.isString()) {\n            switch (op) {\n                case EQUAL: return \"stringMatch\";\n                case NOT_EQUAL: return \"notEqualMatch\";\n                case LIKE: return \"likeMatch\";\n                case CONTAIN: return \"containMatch\";\n                case NOT_CONTAIN: return \"notContainMatch\";\n                default: throw new IllegalArgumentException(\"Unsupported string operator: \" + op);\n            }\n        } else if (value.isArray()) {\n            return \"inMatch\";\n        } else if (value.isNull()) {\n            return op == FilterOperator.EQUAL ? \"stringMatch\" : \"notEqualMatch\";\n        } else if (value.isEnum()) {\n            // Enum comparisons use string matching (e.g., type == RequestType.MQ)\n            switch (op) {\n                case EQUAL: return \"stringMatch\";\n                case NOT_EQUAL: return \"notEqualMatch\";\n                default: throw new IllegalArgumentException(\"Unsupported enum operator: \" + op);\n            }\n        }\n\n        throw new IllegalArgumentException(\"Unsupported filter: \" + filterExpr);\n    }\n\n    /**","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/v2/generator/MetricDefinitionEnricher.java#L464-L500","documentation":"Thrown while mapping a string-valued OAL filter to a matcher type. String values support only EQUAL, NOT_EQUAL, LIKE, CONTAIN, NOT_CONTAIN; ordering operators (>, <, >=, <=) have no string matcher, so the switch falls to default and code generation stops.","triggerScenarios":"An OAL rule applies an ordering operator to a string attribute, e.g. from ServiceTraffic where name > 'm' or attr <= 'z'. The value classifies as a string, the operator is outside the string set, and generation fails.","commonSituations":"Assuming lexicographic comparison works in OAL because it does in SQL; switching a filter's value from number to string (quotes added) while keeping > / < operators.","solutions":["Use a supported string operator: =, !=, like, contain, not contain","If ordering semantics are required, filter on a numeric attribute instead of the string"],"exampleFix":"// before (OAL)\nlateSvc = from ServiceTraffic where name > 'm' --> lateSvc\n// after\nlateSvc = from ServiceTraffic where name like 'n*%' or contain 'n' --> matchedSvc","handlingStrategy":"validation","validationCode":"// Lint rule: string attribute + ordering operator => reject before deploy\nif (attrIsString(attr) && op.in(GREATER, LESS, GREATER_EQUAL, LESS_EQUAL)) {\n    throw new ConfigException(\"Ordering operator \" + op + \" not valid for string \" + attr);\n}","typeGuard":null,"tryCatchPattern":"In OAL lint tooling, catch IllegalArgumentException from the enricher and report file:line of the offending rule; never blanket-catch in OAP startup.","preventionTips":["Remember OAL has no lexicographic string comparison — plan filters around equality and substring operators","Validate rules in CI with a small OAL parse step so operator/type mismatches fail the build, not the deploy"],"tags":["oal","filter","operator-mismatch","validation"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}