{"record":{"id":"527a24fd2c6b4b4d","repo":"apache/seatunnel","slug":"the-length-of-string-column-is-which-exceed","errorCode":null,"errorMessage":"The length of string column {} is {}, which exceeds the maximum length of {}, the length will be set to {}","messagePattern":"The length of string column (.+?) is (.+?), which exceeds the maximum length of (.+?), the length will be set to (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/redshift/RedshiftTypeConverter.java","lineNumber":305,"sourceCode":"                builder.scale(scale);\n                break;\n            case STRING:\n                if (column.getColumnLength() == null || column.getColumnLength() <= 0) {\n                    builder.columnType(\n                            String.format(\n                                    \"%s(%d)\",\n                                    REDSHIFT_CHARACTER_VARYING, MAX_CHARACTER_VARYING_LENGTH));\n                    builder.dataType(REDSHIFT_CHARACTER_VARYING);\n                    builder.length((long) MAX_CHARACTER_VARYING_LENGTH);\n                } else if (column.getColumnLength() <= MAX_CHARACTER_VARYING_LENGTH) {\n                    builder.columnType(\n                            String.format(\n                                    \"%s(%d)\",\n                                    REDSHIFT_CHARACTER_VARYING, column.getColumnLength()));\n                    builder.dataType(REDSHIFT_CHARACTER_VARYING);\n                    builder.length(column.getColumnLength());\n                } else {\n                    log.warn(\n                            \"The length of string column {} is {}, which exceeds the maximum length of {}, \"\n                                    + \"the length will be set to {}\",\n                            column.getName(),\n                            column.getColumnLength(),\n                            MAX_SUPER_LENGTH,\n                            MAX_SUPER_LENGTH);\n                    builder.columnType(REDSHIFT_SUPER);\n                    builder.dataType(REDSHIFT_SUPER);\n                }\n                break;\n            case BYTES:\n                if (column.getColumnLength() == null || column.getColumnLength() <= 0) {\n                    builder.columnType(\n                            String.format(\n                                    \"%s(%d)\", REDSHIFT_BINARY_VARYING, MAX_BINARY_VARYING_LENGTH));\n                    builder.dataType(REDSHIFT_BINARY_VARYING);\n                } else if (column.getColumnLength() <= MAX_BINARY_VARYING_LENGTH) {\n                    builder.columnType(","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/redshift/RedshiftTypeConverter.java#L287-L323","documentation":"This is a WARN log emitted by RedshiftTypeConverter.reconvert during catalog/table conversion. When a SeaTunnel STRING column's declared length exceeds Redshift's maximum for VARCHAR in a SUPER-typed context (MAX_SUPER_LENGTH), the connector silently clamps the column length to the maximum and logs this warning instead of failing. The resulting DDL will use the clamped length, so data longer than the maximum may be truncated or rejected by Redshift.","triggerScenarios":"Writing an auto-created Redshift table where a SeaTunnel column is a string type whose getColumnLength() exceeds MAX_SUPER_LENGTH; occurs inside reconvert() when building the column's Redshift type string.","commonSituations":"Sources that report very large or default string lengths (e.g. Kafka/JSON sources producing Long.MAX_VALUE-length strings, or strings from text files without length metadata) targeting Redshift sink with auto table creation.","solutions":["Reduce the source column length to <= MAX_SUPER_LENGTH (e.g. via a transform casting or truncating the string column)","Pre-create the Redshift table with an appropriate VARCHAR/SUPER column definition so reconvert's clamping is not applied","Ignore the warning if clamping to MAX_SUPER_LENGTH is acceptable; verify no data truncation occurs"],"exampleFix":"// before: source reports length 2000000000 for column 'note'\n// after: truncate in a transform before the sink\n// transform: Sql {\n//   source_table { \n//     sql = \"SELECT SUBSTRING(note, 1, 65535) AS note FROM source_table\"\n//   }\n// }","handlingStrategy":"validation","validationCode":"// Before writing to Redshift, check string lengths\nfor (CatalogColumn col : columns) {\n    if (col.getDataType() is string-like && col.getColumnLength() != null\n        && col.getColumnLength() > maxSuperLength) {\n        // truncate or cast the column upstream\n    }\n}","typeGuard":"boolean fitsRedshiftStringLength(CatalogColumn col, long max) {\n    return col.getColumnLength() == null || col.getColumnLength() <= max;\n}","tryCatchPattern":null,"preventionTips":["Declare explicit, bounded string lengths in the source catalog when possible","Pre-create Redshift tables instead of relying on auto table creation","Truncate/normalize long strings with a transform before the sink","Monitor WARN logs from RedshiftTypeConverter during job runs"],"tags":["jdbc","redshift","type-conversion","string-length"],"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-14T05:17:10.506Z"}