{"record":{"id":"c89ca1543fc752db","repo":"apache/skywalking","slug":"unsupported-value-type","errorCode":null,"errorMessage":"Unsupported value type: {}","messagePattern":"Unsupported value type: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/v2/model/FilterExpression.java","lineNumber":94,"sourceCode":"    }\n\n    private static FilterValue convertToFilterValue(Object value) {\n        if (value == null) {\n            return FilterValue.ofNull();\n        } else if (value instanceof Long || value instanceof Integer) {\n            return FilterValue.ofNumber(((Number) value).longValue());\n        } else if (value instanceof Double || value instanceof Float) {\n            return FilterValue.ofNumber(((Number) value).doubleValue());\n        } else if (value instanceof String) {\n            return FilterValue.ofString((String) value);\n        } else if (value instanceof Boolean) {\n            return FilterValue.ofBoolean((Boolean) value);\n        } else if (value instanceof List) {\n            return FilterValue.ofArray((List<?>) value);\n        } else if (value instanceof FilterValue) {\n            return (FilterValue) value;\n        } else {\n            throw new IllegalArgumentException(\"Unsupported value type: \" + value.getClass());\n        }\n    }\n\n    @Override\n    public boolean equals(Object o) {\n        if (this == o) return true;\n        if (o == null || getClass() != o.getClass()) return false;\n        FilterExpression that = (FilterExpression) o;\n        return Objects.equals(fieldName, that.fieldName) &&\n            operator == that.operator &&\n            Objects.equals(value, that.value);\n    }\n\n    @Override\n    public int hashCode() {\n        return Objects.hash(fieldName, operator, value);\n    }\n","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/apache/skywalking/blob/102af09b4a56064e22050dded10e2c52e490d040/oap-server/oal-rt/src/main/java/org/apache/skywalking/oal/v2/model/FilterExpression.java#L76-L112","documentation":"Thrown by FilterExpression's value-conversion helper (used when the OAL visitor turns a literal into a FilterValue) when the parsed value object is not one of the supported types: Integer/Long, Double/Float, String, Boolean, List, or an already-converted FilterValue. Any other runtime type reaching this branch aborts filter construction.","triggerScenarios":"An OAL filter literal that the ANTLR visitor produces as an unsupported object type — e.g. a null literal, a map literal, or a custom visitor return value; typically only possible when the grammar/visitor is extended or when a new literal kind is added without extending this conversion.","commonSituations":"Extending the OAL grammar with new literal forms (maps, nulls) without updating FilterExpression conversion; contributing a patch to the visitor that returns raw parser context objects; version skew between grammar and oal-rt after a partial rebuild.","solutions":["Use only the supported literal kinds in OAL filters: numbers, quoted strings, booleans, and in(...) lists","If you extended the grammar, add a branch in the conversion for your new literal type producing an appropriate FilterValue.ofNumber/ofString/ofBoolean/ofArray","Run a full clean rebuild (mvnw clean install) so grammar-generated visitor code and oal-rt stay consistent"],"exampleFix":"// before (OAL, unsupported null literal)\nfrom ServiceTraffic where attr = null --> svcNull\n// after: drop the null comparison or handle it via a supported operator/value\nfrom ServiceTraffic where attr != 'x' --> svcOther","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"boolean isSupportedFilterValue(Object v) {\n    return v instanceof Number || v instanceof String || v instanceof Boolean\n        || v instanceof List || v instanceof FilterValue;\n}","tryCatchPattern":"In grammar-extension work, catch IllegalArgumentException at the visitor boundary and rethrow with the offending token/context so users see which literal was rejected.","preventionTips":["Stick to number/string/boolean/in-list literals in OAL filters","After touching oal-grammar or oal-rt, run a full clean build and the OAL RT unit tests so model and visitor stay in sync"],"tags":["oal","filter","type-mapping","grammar"],"backgroundTag":null,"analyzedSha":"102af09b4a56064e22050dded10e2c52e490d040","analyzedAt":"2026-08-14T10:47:52.647Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}