alibaba/DataX · error · RuntimeException
dx_filter para 2 can't be null
Error message
dx_filter para 2 can't be null
What it means
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.
Source
Thrown at core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java:36
@Override
public Record evaluate(Record record, Object... paras) {
int columnIndex;
String code;
String value;
try {
if (paras.length != 3) {
throw new RuntimeException("dx_filter paras must be 3");
}
columnIndex = (Integer) paras[0];
code = (String) paras[1];
value = (String) paras[2];
if (StringUtils.isEmpty(value)) {
throw new RuntimeException("dx_filter para 2 can't be null");
}
} catch (Exception e) {
throw DataXException.asDataXException(TransformerErrorCode.TRANSFORMER_ILLEGAL_PARAMETER, "paras:" + Arrays.asList(paras).toString() + " => " + e.getMessage());
}
Column column = record.getColumn(columnIndex);
try {
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);View on GitHub (pinned to 80ec23d5c5)
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.
Example fix
// before
{"name": "dx_filter", "parameter": [2, "=", ""]}
// after
{"name": "dx_filter", "parameter": [2, "=", "active"]} Defensive patterns
Strategy: validation
Validate before calling
String value = (String) paras[2];
if (value == null || value.trim().isEmpty()) throw new IllegalArgumentException("dx_filter value must be non-empty"); Prevention
- Remove unused filter entries instead of blanking the value.
- Assert non-empty third parameter in generated job JSON.
When it happens
Trigger: 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.
Common situations: Templated job generation that leaves the value blank for optional filters; trailing-comma JSON artifacts producing an empty string.
Related errors
- dx_filter paras must be 3
- CONFIG_ERROR
- dx_digest paras length must be 3
- dx_digest paras index 1 must be md5 or sha1
- dx_digest paras index 2 must be toUpperCase or toLowerCase
AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14).
Data as JSON: /api/errors/ce724e10c00f3ab4.
Report an issue: GitHub.