{"record":{"id":"b82f721fc02212b1","repo":"apache/seatunnel","slug":"the-length-of-binary-column-is-which-exceed","errorCode":null,"errorMessage":"The length of binary column {} is {}, which exceeds the maximum length of {}, the length will be set to {}","messagePattern":"The length of binary 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":333,"sourceCode":"                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(\n                            String.format(\n                                    \"%s(%d)\", REDSHIFT_BINARY_VARYING, column.getColumnLength()));\n                    builder.dataType(REDSHIFT_BINARY_VARYING);\n                    builder.length(column.getColumnLength());\n                } else {\n                    builder.columnType(\n                            String.format(\n                                    \"%s(%d)\", REDSHIFT_BINARY_VARYING, MAX_BINARY_VARYING_LENGTH));\n                    builder.dataType(REDSHIFT_BINARY_VARYING);\n                    log.warn(\n                            \"The length of binary column {} is {}, which exceeds the maximum length of {}, \"\n                                    + \"the length will be set to {}\",\n                            column.getName(),\n                            column.getColumnLength(),\n                            MAX_BINARY_VARYING_LENGTH,\n                            MAX_BINARY_VARYING_LENGTH);\n                }\n                break;\n            case TIME:\n                Integer timeScale = column.getScale();\n                if (timeScale != null && timeScale > MAX_TIME_SCALE) {\n                    timeScale = MAX_TIME_SCALE;\n                    log.warn(\n                            \"The time column {} type time({}) is out of range, \"\n                                    + \"which exceeds the maximum scale of {}, \"\n                                    + \"it will be converted to time({})\",\n                            column.getName(),\n                            column.getScale(),","sourceCodeStart":315,"sourceCodeEnd":351,"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#L315-L351","documentation":"WARN log from RedshiftTypeConverter.reconvert. When a BINARY (BYTES) column's length exceeds Redshift's MAX_BINARY_VARYING_LENGTH, the converter clamps the column type to VARBINARY(MAX_BINARY_VARYING_LENGTH) instead of failing. Data longer than the clamp may be truncated or rejected by the database.","triggerScenarios":"Auto-creating a Redshift table from a catalog where a binary column's getColumnLength() exceeds MAX_BINARY_VARYING_LENGTH; raised in reconvert() during type mapping.","commonSituations":"Ingesting large blobs/bytea from sources that declare unlimited binary length (e.g. Kafka byte arrays, file-based sources) into Redshift with auto table creation.","solutions":["Reduce or declare a smaller binary column length upstream so it fits within MAX_BINARY_VARYING_LENGTH","Pre-create the Redshift table with the desired VARBINARY/BINARY column definition","Accept the clamp; confirm actual payloads fit within MAX_BINARY_VARYING_LENGTH bytes"],"exampleFix":"// before: binary column 'payload' with length 2000000000\n// after: pre-create the sink table\n// CREATE TABLE target (payload VARBINARY(1000000));","handlingStrategy":"validation","validationCode":"if (col.getColumnLength() != null && col.getColumnLength() > maxBinaryVaryingLength) {\n    // shrink or drop the binary column before the sink\n}","typeGuard":"boolean fitsRedshiftBinaryLength(CatalogColumn col, long max) {\n    return col.getColumnLength() == null || col.getColumnLength() <= max;\n}","tryCatchPattern":null,"preventionTips":["Bound binary payload sizes at the source","Pre-create the Redshift table with explicit VARBINARY sizing","Compress or chunk large blobs before ingestion","Watch for the clamp warning and verify payload sizes"],"tags":["jdbc","redshift","type-conversion","binary-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"}