alibaba/DataX · error · RuntimeException
dx_filter paras must be 3
Error message
dx_filter paras must be 3
What it means
The dx_filter transformer requires exactly 3 parameters; a different count throws RuntimeException('dx_filter paras must be 3'), rewrapped as TRANSFORMER_ILLEGAL_PARAMETER. Expected paras: columnIndex (Integer), comparison code (like/>/</=/==/!=/>=/<=), and the comparison value string.
Source
Thrown at core/src/main/java/com/alibaba/datax/core/transport/transformer/FilterTransformer.java:28
/**
* no comments.
* Created by liqiang on 16/3/4.
*/
public class FilterTransformer extends Transformer {
public FilterTransformer() {
setTransformerName("dx_filter");
}
@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 {
View on GitHub (pinned to 80ec23d5c5)
Solutions
- Provide exactly 3 entries: column index, operator string, comparison value (as string).
- Cross-check against DataX transformer documentation examples before running.
Example fix
// before
"transformer": [{"name": "dx_filter", "parameter": [2]}]
// after
"transformer": [{"name": "dx_filter", "parameter": [2, ">", "100"]}] Defensive patterns
Strategy: validation
Validate before calling
if (!(paras.length == 3)) throw new IllegalArgumentException("dx_filter needs exactly [index, code, value]"); Try / catch
catch (DataXException e) when TRANSFORMER_ILLEGAL_PARAMETER: log paras and fail fast; config error, do not retry.
Prevention
- Template dx_filter entries as [index, operator, value].
- Lint transformer blocks before job submission.
When it happens
Trigger: Declaring {"name":"dx_filter","parameter":[2]} or [2,">",100,extra] in the job transformer block — anything with parameter-array length != 3.
Common situations: Omitting the value to 'just filter on the operator'; adding a fourth param by copy-paste from dx_digest examples.
Related errors
- dx_filter para 2 can't be null
- 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
- dx_filter can't support code:%s
AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14).
Data as JSON: /api/errors/17e2b7ebdf132492.
Report an issue: GitHub.