apache/skywalking · error · IllegalArgumentException

Unsupported string operator: {}

Error message

Unsupported string operator: {}

What it means

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.

Source

Thrown at oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/v2/generator/MetricDefinitionEnricher.java:482

            return op == FilterOperator.EQUAL ? "booleanMatch" : "booleanNotEqualMatch";
        } else if (value.isNumber()) {
            switch (op) {
                case EQUAL: return "numberMatch";
                case NOT_EQUAL: return "notEqualMatch";
                case GREATER: return "greaterMatch";
                case LESS: return "lessMatch";
                case GREATER_EQUAL: return "greaterEqualMatch";
                case LESS_EQUAL: return "lessEqualMatch";
                default: throw new IllegalArgumentException("Unsupported number operator: " + op);
            }
        } else if (value.isString()) {
            switch (op) {
                case EQUAL: return "stringMatch";
                case NOT_EQUAL: return "notEqualMatch";
                case LIKE: return "likeMatch";
                case CONTAIN: return "containMatch";
                case NOT_CONTAIN: return "notContainMatch";
                default: throw new IllegalArgumentException("Unsupported string operator: " + op);
            }
        } else if (value.isArray()) {
            return "inMatch";
        } else if (value.isNull()) {
            return op == FilterOperator.EQUAL ? "stringMatch" : "notEqualMatch";
        } else if (value.isEnum()) {
            // Enum comparisons use string matching (e.g., type == RequestType.MQ)
            switch (op) {
                case EQUAL: return "stringMatch";
                case NOT_EQUAL: return "notEqualMatch";
                default: throw new IllegalArgumentException("Unsupported enum operator: " + op);
            }
        }

        throw new IllegalArgumentException("Unsupported filter: " + filterExpr);
    }

    /**

View on GitHub (pinned to 102af09b4a)

Solutions

  1. Use a supported string operator: =, !=, like, contain, not contain
  2. If ordering semantics are required, filter on a numeric attribute instead of the string

Example fix

// before (OAL)
lateSvc = from ServiceTraffic where name > 'm' --> lateSvc
// after
lateSvc = from ServiceTraffic where name like 'n*%' or contain 'n' --> matchedSvc
Defensive patterns

Strategy: validation

Validate before calling

// Lint rule: string attribute + ordering operator => reject before deploy
if (attrIsString(attr) && op.in(GREATER, LESS, GREATER_EQUAL, LESS_EQUAL)) {
    throw new ConfigException("Ordering operator " + op + " not valid for string " + attr);
}

Try / catch

In OAL lint tooling, catch IllegalArgumentException from the enricher and report file:line of the offending rule; never blanket-catch in OAP startup.

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/skywalking@102af09b4a (2026-08-14). Data as JSON: /api/errors/34f02588793b6afe. Report an issue: GitHub.