alibaba/DataX · error · RuntimeException

dx_filter can't support code:%s

Error message

dx_filter can't support code:%s

What it means

dx_filter supports only the operators like, >, <, =/==, !=, >=, <=; any other code string throws RuntimeException('dx_filter can't support code:...'), rewrapped as TRANSFORMER_RUN_EXCEPTION. Unlike the parameter-shape errors (52/53, ILLEGAL_PARAMETER) this fires at row-processing time under the RUN_EXCEPTION code.

Source

Thrown at core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java:64

            if (code.equalsIgnoreCase("like")) {
                return doLike(record, value, column);
            } else if (code.equalsIgnoreCase("not like")) {
                return doNotLike(record, value, column);
            } else if (code.equalsIgnoreCase(">")) {
                return doGreat(record, value, column, false);
            } else if (code.equalsIgnoreCase("<")) {
                return doLess(record, value, column, false);
            } else if (code.equalsIgnoreCase("=") || code.equalsIgnoreCase("==")) {
                return doEqual(record, value, column);
            } else if (code.equalsIgnoreCase("!=")) {
                return doNotEqual(record, value, column);
            } else if (code.equalsIgnoreCase(">=")) {
                return doGreat(record, value, column, true);
            } else if (code.equalsIgnoreCase("<=")) {
                return doLess(record, value, column, true);
            } else {
                throw new RuntimeException("dx_filter can't support code:" + code);
            }
        } catch (Exception e) {
            throw DataXException.asDataXException(TransformerErrorCode.TRANSFORMER_RUN_EXCEPTION, e.getMessage(), e);
        }
    }


    private Record doGreat(Record record, String value, Column column, boolean hasEqual) {

        //如果字段为空,直接不参与比较。即空也属于无穷小
        if(column.getRawData() == null){
            return record;
        }
        if (column instanceof DoubleColumn) {
            Double ori = column.asDouble();
            double val = Double.parseDouble(value);

            if (hasEqual) {

View on GitHub (pinned to 80ec23d5c5)

Solutions

  1. Restrict the operator to one of: like, >, <, =, ==, !=, >=, <=.
  2. Express 'in' as multiple dx_filter entries or a custom transformer.
  3. Watch for full-width/unicode operator characters from Chinese IME input.

Example fix

// before
{"name": "dx_filter", "parameter": [2, "in", "1,2,3"]}

// after (multiple filters chained)
"transformer": [
  {"name": "dx_filter", "parameter": [2, "=", "1"]}
]
Defensive patterns

Strategy: validation

Validate before calling

Set<String> ok = new HashSet<>(Arrays.asList("like", ">", "<", "=", "==", "!=", ">=", "<="));
if (!ok.contains(code)) throw new IllegalArgumentException("unsupported dx_filter code: " + code);

Try / catch

catch (DataXException e) when TRANSFORMER_RUN_EXCEPTION and message contains "can't support code": fail job, fix operator.

Prevention

When it happens

Trigger: Passing an unsupported operator as paras[1]: {"name":"dx_filter","parameter":[2,"in","a,b"]} or "contains", "between", SQL-style "LIKE " with trailing content.

Common situations: Trying SQL-like semantics (IN, NOT LIKE, BETWEEN) that dx_filter never implemented; locale-specific operator typos (full-width >).

Related errors


AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14). Data as JSON: /api/errors/7b4f7f71cb644c3c. Report an issue: GitHub.