alibaba/DataX · error · IllegalArgumentException

参数 bigInteger 不能为空.

Error message

参数 bigInteger 不能为空.

What it means

RangeSplitUtil.stringToBigInteger(String, int radix) throws IllegalArgumentException('参数 bigInteger 不能为空.') when the input string is null. It encodes an ASCII string into a BigInteger (base-radix positional encoding of char codes) so string ranges can be split numerically; a null string has no encoding.

Source

Thrown at common/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java:107

            }

            return result;
        }
    }

    private static void checkIfBetweenRange(int value, int left, int right) {
        if (value < left || value > right) {
            throw new IllegalArgumentException(String.format("parameter can not <[%s] or >[%s].",
                    left, right));
        }
    }

    /**
     * 由于只支持 ascii 码对应字符,所以radix 范围为[1,128]
     */
    public static BigInteger stringToBigInteger(String aString, int radix) {
        if (null == aString) {
            throw new IllegalArgumentException("参数 bigInteger 不能为空.");
        }

        checkIfBetweenRange(radix, 1, 128);

        BigInteger result = BigInteger.ZERO;
        BigInteger radixBigInteger = BigInteger.valueOf(radix);

        int tempChar;
        int k = 0;

        for (int i = aString.length() - 1; i >= 0; i--) {
            tempChar = aString.charAt(i);
            if (tempChar >= 128) {
                throw new IllegalArgumentException(String.format("根据字符串进行切分时仅支持 ASCII 字符串,而字符串:[%s]非 ASCII 字符串.", aString));
            }
            result = result.add(BigInteger.valueOf(tempChar).multiply(radixBigInteger.pow(k)));
            k++;
        }

View on GitHub (pinned to 80ec23d5c5)

Solutions

  1. Ensure the splitPk string column is NOT NULL and contains data.
  2. Check that the job config actually supplies the string range values (no missing/misspelled keys).
  3. Null-check before calling and fall back to a non-split single task.

Example fix

// before
BigInteger start = RangeSplitUtil.stringToBigInteger(startStr, radix);

// after
if (startStr == null || endStr == null) {
    return false; // caller: skip string splitting
}
BigInteger start = RangeSplitUtil.stringToBigInteger(startStr, radix);
Defensive patterns

Strategy: type-guard

Validate before calling

if (str == null) { /* skip string split */ }
BigInteger v = RangeSplitUtil.stringToBigInteger(str, radix);

Type guard

static boolean splittableString(String s, int radix) {
    return s != null && radix >= 1 && radix <= 128;
}

Prevention

When it happens

Trigger: Calling stringToBigInteger(null, radix). Occurs when a string splitPk's boundary value is null — e.g. the reader could not obtain min/max string values, or a config key holding the string range was absent.

Common situations: String-type splitPk on a nullable column; job JSON missing the range parameter that gets passed through to the splitter.

Related errors


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