{"record":{"id":"1e1c2f55c9c8f9b4","repo":"apache/seatunnel","slug":"cannot-compare-null-values-in-numeric-comparison","errorCode":null,"errorMessage":"Cannot compare null values in numeric comparison: leftPresent=%s, rightPresent=%s","messagePattern":"Cannot compare null values in numeric comparison: leftPresent=(.+?), rightPresent=(.+?)","errorType":"validation","errorClass":"org.apache.seatunnel.api.configuration.util.OptionValidationException","httpStatus":null,"severity":"error","filePath":"seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConditionEvaluators.java","lineNumber":187,"sourceCode":"                ConditionOperator.EXTENSION,\n                (v, c, cfg) -> {\n                    ConditionExtension<Object> ext = (ConditionExtension<Object>) c.getExtension();\n                    return ext.evaluate(cfg, v);\n                });\n\n        for (ConditionOperator op : ConditionOperator.values()) {\n            if (!m.containsKey(op)) {\n                throw new IllegalStateException(\n                        \"Missing evaluator for ConditionOperator.\" + op.name());\n            }\n        }\n        return Collections.unmodifiableMap(m);\n    }\n\n    @SuppressWarnings({\"rawtypes\"})\n    static int compareNumbers(Object a, Object b) {\n        if (a == null || b == null) {\n            throw new OptionValidationException(\n                    \"Cannot compare null values in numeric comparison: leftPresent=%s, rightPresent=%s\",\n                    a != null, b != null);\n        }\n        if (a instanceof Number && b instanceof Number) {\n            return compareNumberValues((Number) a, (Number) b);\n        }\n        if (a instanceof Comparable && b instanceof Comparable) {\n            return ((Comparable) a).compareTo(b);\n        }\n        throw new OptionValidationException(\n                \"Cannot compare values of type %s and %s\",\n                a.getClass().getSimpleName(), b.getClass().getSimpleName());\n    }\n\n    private static int compareNumberValues(Number a, Number b) {\n        if (a instanceof BigDecimal || b instanceof BigDecimal) {\n            BigDecimal bdA =\n                    a instanceof BigDecimal ? (BigDecimal) a : new BigDecimal(a.toString());","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConditionEvaluators.java#L169-L205","documentation":"Thrown from ConditionEvaluators.compareNumbers when a numeric condition operator (e.g. GT, LT, EQ) is evaluated and one side of the comparison is null. At its throw site it means the conditional option referenced a value that is absent (missing key or null), so no ordering comparison is defined; it is a validation guard against ambiguous null ordering, not a numeric-format error. The message reports which side was present via booleans.","triggerScenarios":"Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/ConditionEvaluators.java:187 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the config option the condition compares against is defined and non-null before the condition is evaluated","Use a condition operator that tolerates absence, or guard the conditional option with a presence check (e.g. option required=true or a default value)","Provide a sensible default for the option via Option.defaultValue so the left/right operand is never null"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}