apache/seatunnel · warning

The length ' ' of the column ` ` is too large to be…

Error message

The length '{}' of the column `{}` is too large to be supported, truncating it to '{}'

What it means

CustomColumnDefinitionParserListener.parseLength() parses a column's declared length from the DDL/definition. When the parsed value exceeds Integer.MAX_VALUE (e.g. LONGTEXT-style lengths or huge VARCHAR declarations), the value cannot fit the Integer-based SeaTunnel type, so it is truncated to Integer.MAX_VALUE and this warning is logged.

Solutions

  1. Accept the truncation if the data actually fits — verify with SELECT MAX(CHAR_LENGTH(col)) FROM table;
  2. Reduce the column definition length in MySQL if the huge length is not really needed (ALTER TABLE ... MODIFY col VARCHAR(<smaller>)).
  3. Use a TEXT/BLOB-typed mapping or byte/STRING SeaTunnel type instead of a length-constrained type for such columns.
  4. Review the schema conversion to see whether the downstream sink supports large STRING lengths.

Example fix

-- before
CREATE TABLE t (name VARCHAR(4294967295));
-- after
CREATE TABLE t (name VARCHAR(16383));
Defensive patterns

Strategy: validation

Validate before calling

// Before ingesting, check declared column lengths:
// SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH FROM information_schema.columns
// WHERE table_schema='db' AND table_name='t' AND CHARACTER_MAXIMUM_LENGTH > 2147483647;

Prevention

When it happens

Trigger: parseLength(String) is invoked from length() and resolveColumnDataType() with a numeric length string such that Long.parseLong(lengthStr) > Integer.MAX_VALUE; the warning logs the original length, the column name, and the truncation target Integer.MAX_VALUE.

Common situations: Columns defined as VARCHAR with extremely large lengths, TINYBLOB/LONGTEXT metadata reported with large character lengths by MySQL, multi-byte charset columns where reported character length is inflated, schema captured from DDL with oversized lengths.

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/3a1b5853c95438be. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/parser/CustomColumnDefinitionParserListener.java:307

        if (columnEditor.length() == -1) {
            columnEditor.length((int) dataType.length());
        }
        if (!columnEditor.scale().isPresent() && dataType.scale() != Column.UNSET_INT_VALUE) {
            columnEditor.scale(dataType.scale());
        }
        if (Types.NCHAR == jdbcDataType || Types.NVARCHAR == jdbcDataType) {
            // NCHAR and NVARCHAR columns always uses utf8 as charset
            columnEditor.charsetName("utf8");
        } else {
            columnEditor.charsetName(charsetName);
        }
    }

    private Integer parseLength(String lengthStr) {
        Long length = Long.parseLong(lengthStr);
        if (length > Integer.MAX_VALUE) {
            log.warn(
                    "The length '{}' of the column `{}` is too large to be supported, truncating it to '{}'",
                    length,
                    columnEditor.name(),
                    Integer.MAX_VALUE);
            length = (long) Integer.MAX_VALUE;
        }
        return length.intValue();
    }

    private void serialColumn() {
        if (optionalColumn.get() == null) {
            optionalColumn.set(Boolean.FALSE);
        }
        uniqueColumn = true;
        columnEditor.autoIncremented(true);
        columnEditor.generated(true);
    }
}

View on GitHub (pinned to cf67b549a7)