{"record":{"id":"b71cb9ba41e72985","repo":"apache/seatunnel","slug":"invalid-filter-condition","errorCode":null,"errorMessage":"Invalid filter condition: ","messagePattern":"Invalid filter condition: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-kudu/src/main/java/org/apache/seatunnel/connectors/seatunnel/kudu/util/KuduUtil.java","lineNumber":220,"sourceCode":"            return;\n        }\n\n        List<String> conditions = Arrays.asList(filter.trim().split(\"\\\\s+AND\\\\s+\"));\n\n        Pattern pattern = Pattern.compile(\"(\\\\w+)\\\\s*([=><]=?|<=|>=)\\\\s*(.+)\");\n        for (String condition : conditions) {\n            Matcher matcher = pattern.matcher(condition.trim());\n\n            String column = null;\n            String op = null;\n            String value = null;\n\n            if (matcher.matches()) {\n                column = matcher.group(1);\n                op = matcher.group(2);\n                value = matcher.group(3);\n            } else {\n                throw new IllegalArgumentException(\"Invalid filter condition: \" + condition);\n            }\n\n            if (!schema.hasColumn(column)) {\n                throw new KuduConnectorException(\n                        CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                        \"Column not found in Kudu schema: \" + column);\n            }\n\n            Type type = schema.getColumn(column).getType();\n\n            KuduPredicate.ComparisonOp comparisonOp = null;\n            switch (op) {\n                case \"=\":\n                    comparisonOp = KuduPredicate.ComparisonOp.EQUAL;\n                    break;\n                case \">\":\n                    comparisonOp = KuduPredicate.ComparisonOp.GREATER;\n                    break;","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-kudu/src/main/java/org/apache/seatunnel/connectors/seatunnel/kudu/util/KuduUtil.java#L202-L238","documentation":"KuduUtil.addPredicates parses filter condition strings of the form 'column op value' with a regex; when a condition string does not match the expected pattern, it throws an IllegalArgumentException 'Invalid filter condition: <condition>'. This is a pure input-format error raised before any Kudu schema interaction.","triggerScenarios":"A filter condition string passed to getKuduScanToken (e.g. from query.kudu.filters style config) does not match the pattern column(op)value, such as missing spaces around the operator, quoting issues, or extra clauses like AND/OR combined into one condition string.","commonSituations":"Users write filters like 'age >= 18 AND city = \"NY\"' as a single condition instead of splitting them; missing whitespace around the operator ('age>=18' may or may not match depending on regex); quotes around string values not expected by the regex.","solutions":["Inspect the condition string and rewrite it to the exact expected format 'column op value' with the operator one of =, !=, >, >=, <, <=","Split combined conditions on AND/OR and pass each simple predicate separately","Check for stray whitespace, tabs, or quotes in the configured filter value","Read KuduUtil.addPredicates regex to confirm the accepted syntax for your connector version"],"exampleFix":"// before\nString condition = \"age >= 18 AND city = NY\";\n// after: split into simple predicates\nString[] conditions = {\"age >= 18\", \"city = NY\"};","handlingStrategy":"validation","validationCode":"Pattern P = Pattern.compile(\"^\\\\s*(\\\\S+)\\\\s*(=|!=|>=|<=|>|<)\\\\s*(\\\\S+)\\\\s*$\");\nif (!P.matcher(condition).matches()) {\n    throw new IllegalArgumentException(\"Invalid filter condition: \" + condition);\n}","typeGuard":null,"tryCatchPattern":"try {\n    kuduUtil.getKuduScanToken(filters, ...);\n} catch (IllegalArgumentException e) {\n    // fix condition format: 'column op value'\n}","preventionTips":["Use only simple 'column op value' conditions, one per predicate","Split AND/OR expressions before passing to the connector","Avoid stray quotes and whitespace in filter strings","Check the connector's documented filter syntax for your version"],"tags":["argument-parsing","filters","kudu"],"backgroundTag":"invalid-argument-format","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}