alibaba/DataX · error · IllegalArgumentException
切分份数不能小于1. 此处:expectSliceNumber=[%s].
Error message
切分份数不能小于1. 此处:expectSliceNumber=[%s].
What it means
RangeSplitUtil.doBigIntegerSplit (and its long wrapper doLongSplit) requires expectSliceNumber >= 1; a smaller value throws IllegalArgumentException. This utility chops a numeric range into N sub-ranges for splitPk parallelism, so a slice count of 0 or negative is meaningless.
Source
Thrown at common/src/main/java/com/alibaba/datax/common/util/RangeSplitUtil.java:45
}
return result;
}
public static long[] doLongSplit(long left, long right, int expectSliceNumber) {
BigInteger[] result = doBigIntegerSplit(BigInteger.valueOf(left),
BigInteger.valueOf(right), expectSliceNumber);
long[] returnResult = new long[result.length];
for (int i = 0, len = result.length; i < len; i++) {
returnResult[i] = result[i].longValue();
}
return returnResult;
}
public static BigInteger[] doBigIntegerSplit(BigInteger left, BigInteger right, int expectSliceNumber) {
if (expectSliceNumber < 1) {
throw new IllegalArgumentException(String.format(
"切分份数不能小于1. 此处:expectSliceNumber=[%s].", expectSliceNumber));
}
if (null == left || null == right) {
throw new IllegalArgumentException(String.format(
"对 BigInteger 进行切分时,其左右区间不能为 null. 此处:left=[%s],right=[%s].", left, right));
}
if (left.compareTo(right) == 0) {
return new BigInteger[]{left, right};
} else {
// 调整大小顺序,确保 left < right
if (left.compareTo(right) > 0) {
BigInteger temp = left;
left = right;
right = temp;
}
View on GitHub (pinned to 80ec23d5c5)
Solutions
- Set job.setting.speed.channel (or the analogous channel/parallelism setting) to at least 1.
- If you call the splitter directly, clamp: int n = Math.max(1, computedSlices).
- For very small tables, disable splitPk (remove the splitPk config) instead of forcing a 0-way split.
Example fix
// before long[] points = RangeSplitUtil.doLongSplit(min, max, adviceSliceNumber); // after int slices = Math.max(1, adviceSliceNumber); long[] points = RangeSplitUtil.doLongSplit(min, max, slices);
Defensive patterns
Strategy: validation
Validate before calling
int slices = Math.max(1, computedSliceNumber); BigInteger[] points = RangeSplitUtil.doBigIntegerSplit(left, right, slices);
Try / catch
try {
RangeSplitUtil.doBigIntegerSplit(left, right, n);
} catch (IllegalArgumentException e) {
// fall back to single-task split
return new BigInteger[]{left, right};
} Prevention
- Never configure 0 channels when splitPk is enabled.
- Clamp computed slice counts to >= 1 at the call site.
When it happens
Trigger: Passing expectSliceNumber < 1. In DataX this value is usually derived from channel count / table count / adviceNum; if the job is configured with 0 channels or a computation rounds down to 0, the split step throws this.
Common situations: Setting job.setting.speed.channel to 0, or a plugin computing slices as (records / batchSize) that evaluates to 0 for tiny tables while splitPk is still enabled.
Related errors
- 对 BigInteger 进行切分时,其左右区间不能为 null. 此处:left=[%s],right=[%s].
- CONFIG_ERROR
- 您提供的作业配置有误, List不能为空.
- 参数 bigInteger 不能为空.
- 根据字符串进行切分时仅支持 ASCII 字符串,而字符串:[%s]非 ASCII 字符串.
AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14).
Data as JSON: /api/errors/2016ddbf0e397508.
Report an issue: GitHub.