{"record":{"id":"ce724e10c00f3ab4","repo":"alibaba/DataX","slug":"dx-filter-para-2-can-t-be-null","errorCode":null,"errorMessage":"dx_filter para 2 can't be null","messagePattern":"dx_filter para 2 can't be null","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java","lineNumber":36,"sourceCode":"\n    @Override\n    public Record evaluate(Record record, Object... paras) {\n\n        int columnIndex;\n        String code;\n        String value;\n\n        try {\n            if (paras.length != 3) {\n                throw new RuntimeException(\"dx_filter paras must be 3\");\n            }\n\n            columnIndex = (Integer) paras[0];\n            code = (String) paras[1];\n            value = (String) paras[2];\n\n            if (StringUtils.isEmpty(value)) {\n                throw new RuntimeException(\"dx_filter para 2 can't be null\");\n            }\n        } catch (Exception e) {\n            throw DataXException.asDataXException(TransformerErrorCode.TRANSFORMER_ILLEGAL_PARAMETER, \"paras:\" + Arrays.asList(paras).toString() + \" => \" + e.getMessage());\n        }\n\n\n        Column column = record.getColumn(columnIndex);\n\n        try {\n\n            if (code.equalsIgnoreCase(\"like\")) {\n                return doLike(record, value, column);\n            } else if (code.equalsIgnoreCase(\"not like\")) {\n                return doNotLike(record, value, column);\n            } else if (code.equalsIgnoreCase(\">\")) {\n                return doGreat(record, value, column, false);\n            } else if (code.equalsIgnoreCase(\"<\")) {\n                return doLess(record, value, column, false);","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/alibaba/DataX/blob/80ec23d5c5328eb90ca364d2749e92dfaf44541e/core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java#L18-L54","documentation":"The dx_filter transformer rejects an empty/null comparison value: StringUtils.isEmpty(paras[2]) throws RuntimeException('dx_filter para 2 can't be null'), rewrapped as TRANSFORMER_ILLEGAL_PARAMETER. Filtering always needs a concrete right-hand value to compare against; there is no 'compare with empty' mode.","triggerScenarios":"Declaring the third parameter as \"\" or null: {\"name\":\"dx_filter\",\"parameter\":[2,\">\",\"\"]}. Note the length check (error 52) passes because the array has 3 elements — the slot is just empty.","commonSituations":"Templated job generation that leaves the value blank for optional filters; trailing-comma JSON artifacts producing an empty string.","solutions":["Set a concrete comparison value string, e.g. \"100\" or \"beijing\".","If the filter is optional, remove the whole transformer entry instead of leaving an empty value.","Assert non-empty third param in job-generation code."],"exampleFix":"// before\n{\"name\": \"dx_filter\", \"parameter\": [2, \"=\", \"\"]}\n\n// after\n{\"name\": \"dx_filter\", \"parameter\": [2, \"=\", \"active\"]}","handlingStrategy":"validation","validationCode":"String value = (String) paras[2];\nif (value == null || value.trim().isEmpty()) throw new IllegalArgumentException(\"dx_filter value must be non-empty\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remove unused filter entries instead of blanking the value.","Assert non-empty third parameter in generated job JSON."],"tags":["datax","transformer","dx-filter","config","validation"],"backgroundTag":null,"analyzedSha":"80ec23d5c5328eb90ca364d2749e92dfaf44541e","analyzedAt":"2026-08-14T15:33:51.187Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}