apache/seatunnel · error · IllegalArgumentException

The auto increment start value is too large, please check…

Error message

The auto increment start value is too large, please check your configuration.

What it means

When auto-increment is enabled for a fake primary-key column, the connector validates that autoIncrementStart + (parallelism * rowNum) fits within Integer.MAX_VALUE before generating ids. If the configured start value combined with the total rows to generate would overflow an int, randomInt throws IllegalArgumentException.

Solutions

  1. Lower the fake.data.auto-increment.start value so that start + (parallelism * rowNum) stays below Integer.MAX_VALUE.
  2. Reduce fake.data.rownum (and/or parallelism) so the total generated rows fit within the int range from the start value.
  3. Change the column type to BIGINT if you need a large id range, if the generator/auto-increment path supports it.
  4. Compute the budget: max start ≈ 2147483647 - (parallelism * rowNum), and keep your start below it.

Example fix

// before
fake.data.auto-increment.enabled = true
fake.data.auto-increment.start = 2147483000
fake.data.rownum = 10000
// after
fake.data.auto-increment.enabled = true
fake.data.auto-increment.start = 1000000
fake.data.rownum = 10000
Defensive patterns

Strategy: validation

Validate before calling

long start = config.getAutoIncrementStart();
long total = (long) config.getParallelism() * config.getRowNum();
if (start + total > Integer.MAX_VALUE) {
    throw new IllegalArgumentException(
        "auto-increment.start too large: max allowed is " + (Integer.MAX_VALUE - total));
}

Try / catch

try {
    runFakeSourceJob(config);
} catch (IllegalArgumentException e) {
    if (e.getMessage().contains("auto increment start value is too large")) {
        log.warn("Lower auto-increment start or reduce rownum/parallelism", e);
        config.setAutoIncrementStart(defaultSafeStart);
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Fake source config with fake.data.auto-increment.enabled=true on a primary column, and auto-increment-start set so high that start + (parallelism * rowNum) exceeds Integer.MAX_VALUE (2147483647).

Common situations: Copying a large auto-increment start from a production database (e.g. values near 2^31) into the fake source config; large rowNum multiplied by parallelism pushing the total over the int limit; misunderstanding that generated ids are 32-bit ints.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/bac66e8e396e4300. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-fake/src/main/java/org/apache/seatunnel/connectors/seatunnel/fake/utils/FakeDataRandomUtils.java:104

        return (byte) RandomUtils.nextInt(fakeConfig.getTinyintMin(), fakeConfig.getTinyintMax());
    }

    public Short randomSmallint(Column column) {
        List<Integer> smallintTemplate = fakeConfig.getSmallintTemplate();
        if (!CollectionUtils.isEmpty(smallintTemplate)) {
            return randomFromList(smallintTemplate).shortValue();
        }
        return (short)
                RandomUtils.nextInt(fakeConfig.getSmallintMin(), fakeConfig.getSmallintMax());
    }

    public Integer randomInt(Column column) {
        if (fakeConfig.getAutoIncrementEnabled()
                && IdGeneratorUtils.isPrimaryColumn(fakeConfig, column.getName())) {
            if (fakeConfig.getAutoIncrementStart()
                            + ((long) fakeConfig.getParallelism() * fakeConfig.getRowNum())
                    > Integer.MAX_VALUE) {
                throw new IllegalArgumentException(
                        "The auto increment start value is too large, please check your configuration.");
            }
            return IdGeneratorUtils.getIdGenerator(jobId, fakeConfig, column.getName())
                    .orElseThrow(
                            () ->
                                    new IllegalArgumentException(
                                            "Auto increment is enabled, but no id generator found."))
                    .getNextId()
                    .intValue();
        }
        List<Integer> intTemplate = fakeConfig.getIntTemplate();
        if (!CollectionUtils.isEmpty(intTemplate)) {
            return randomFromList(intTemplate);
        }
        return RandomUtils.nextInt(fakeConfig.getIntMin(), fakeConfig.getIntMax());
    }

    public Long randomBigint(Column column) {

View on GitHub (pinned to cf67b549a7)