apache/seatunnel · error · IllegalArgumentException

Invalid filter condition:

Error message

Invalid filter condition: 

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-kudu/src/main/java/org/apache/seatunnel/connectors/seatunnel/kudu/util/KuduUtil.java:220

            return;
        }

        List<String> conditions = Arrays.asList(filter.trim().split("\\s+AND\\s+"));

        Pattern pattern = Pattern.compile("(\\w+)\\s*([=><]=?|<=|>=)\\s*(.+)");
        for (String condition : conditions) {
            Matcher matcher = pattern.matcher(condition.trim());

            String column = null;
            String op = null;
            String value = null;

            if (matcher.matches()) {
                column = matcher.group(1);
                op = matcher.group(2);
                value = matcher.group(3);
            } else {
                throw new IllegalArgumentException("Invalid filter condition: " + condition);
            }

            if (!schema.hasColumn(column)) {
                throw new KuduConnectorException(
                        CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,
                        "Column not found in Kudu schema: " + column);
            }

            Type type = schema.getColumn(column).getType();

            KuduPredicate.ComparisonOp comparisonOp = null;
            switch (op) {
                case "=":
                    comparisonOp = KuduPredicate.ComparisonOp.EQUAL;
                    break;
                case ">":
                    comparisonOp = KuduPredicate.ComparisonOp.GREATER;
                    break;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Inspect the condition string and rewrite it to the exact expected format 'column op value' with the operator one of =, !=, >, >=, <, <=
  2. Split combined conditions on AND/OR and pass each simple predicate separately
  3. Check for stray whitespace, tabs, or quotes in the configured filter value
  4. Read KuduUtil.addPredicates regex to confirm the accepted syntax for your connector version

Example fix

// before
String condition = "age >= 18 AND city = NY";
// after: split into simple predicates
String[] conditions = {"age >= 18", "city = NY"};
Defensive patterns

Strategy: validation

Validate before calling

Pattern P = Pattern.compile("^\\s*(\\S+)\\s*(=|!=|>=|<=|>|<)\\s*(\\S+)\\s*$");
if (!P.matcher(condition).matches()) {
    throw new IllegalArgumentException("Invalid filter condition: " + condition);
}

Try / catch

try {
    kuduUtil.getKuduScanToken(filters, ...);
} catch (IllegalArgumentException e) {
    // fix condition format: 'column op value'
}

Prevention

When it happens

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

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

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/b71cb9ba41e72985. Report an issue: GitHub.