{"record":{"id":"3a1b5853c95438be","repo":"apache/seatunnel","slug":"the-length-of-the-column-is-too-large-to","errorCode":null,"errorMessage":"The length '{}' of the column `{}` is too large to be supported, truncating it to '{}'","messagePattern":"The length '(.+?)' of the column `(.+?)` is too large to be supported, truncating it to '(.+?)'","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/parser/CustomColumnDefinitionParserListener.java","lineNumber":307,"sourceCode":"\n        if (columnEditor.length() == -1) {\n            columnEditor.length((int) dataType.length());\n        }\n        if (!columnEditor.scale().isPresent() && dataType.scale() != Column.UNSET_INT_VALUE) {\n            columnEditor.scale(dataType.scale());\n        }\n        if (Types.NCHAR == jdbcDataType || Types.NVARCHAR == jdbcDataType) {\n            // NCHAR and NVARCHAR columns always uses utf8 as charset\n            columnEditor.charsetName(\"utf8\");\n        } else {\n            columnEditor.charsetName(charsetName);\n        }\n    }\n\n    private Integer parseLength(String lengthStr) {\n        Long length = Long.parseLong(lengthStr);\n        if (length > Integer.MAX_VALUE) {\n            log.warn(\n                    \"The length '{}' of the column `{}` is too large to be supported, truncating it to '{}'\",\n                    length,\n                    columnEditor.name(),\n                    Integer.MAX_VALUE);\n            length = (long) Integer.MAX_VALUE;\n        }\n        return length.intValue();\n    }\n\n    private void serialColumn() {\n        if (optionalColumn.get() == null) {\n            optionalColumn.set(Boolean.FALSE);\n        }\n        uniqueColumn = true;\n        columnEditor.autoIncremented(true);\n        columnEditor.generated(true);\n    }\n}","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/source/parser/CustomColumnDefinitionParserListener.java#L289-L325","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Accept the truncation if the data actually fits — verify with SELECT MAX(CHAR_LENGTH(col)) FROM table;","Reduce the column definition length in MySQL if the huge length is not really needed (ALTER TABLE ... MODIFY col VARCHAR(<smaller>)).","Use a TEXT/BLOB-typed mapping or byte/STRING SeaTunnel type instead of a length-constrained type for such columns.","Review the schema conversion to see whether the downstream sink supports large STRING lengths."],"exampleFix":"-- before\nCREATE TABLE t (name VARCHAR(4294967295));\n-- after\nCREATE TABLE t (name VARCHAR(16383));","handlingStrategy":"validation","validationCode":"// Before ingesting, check declared column lengths:\n// SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH FROM information_schema.columns\n// WHERE table_schema='db' AND table_name='t' AND CHARACTER_MAXIMUM_LENGTH > 2147483647;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid VARCHAR lengths near 4G in MySQL DDL","Check CHARACTER_MAXIMUM_LENGTH in information_schema for captured tables","Remember multi-byte charsets can inflate reported lengths","Downstream sinks must accept the truncated Integer.MAX_VALUE length"],"tags":["mysql","cdc","schema","truncation"],"backgroundTag":"value-out-of-range","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}