{"record":{"id":"d1e02eea65915540","repo":"apache/seatunnel","slug":"the-length-of-blob-type-is-out-of-range-it-wil","errorCode":null,"errorMessage":"The length of blob type {} is out of range, it will be converted to {}({})","messagePattern":"The length of blob type (.+?) is out of range, it will be converted 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/db2/DB2TypeConverter.java","lineNumber":343,"sourceCode":"                    builder.columnType(\n                            String.format(\"%s(%s)\", DB2_VARBINARY, MAX_VARBINARY_LENGTH));\n                    builder.dataType(DB2_VARBINARY);\n                    builder.length(column.getColumnLength());\n                } else if (column.getColumnLength() <= MAX_BINARY_LENGTH) {\n                    builder.columnType(\n                            String.format(\"%s(%s)\", DB2_BINARY, column.getColumnLength()));\n                    builder.dataType(DB2_BINARY);\n                    builder.length(column.getColumnLength());\n                } else if (column.getColumnLength() <= MAX_VARBINARY_LENGTH) {\n                    builder.columnType(\n                            String.format(\"%s(%s)\", DB2_VARBINARY, column.getColumnLength()));\n                    builder.dataType(DB2_VARBINARY);\n                    builder.length(column.getColumnLength());\n                } else {\n                    long length = column.getColumnLength();\n                    if (length > MAX_BLOB_LENGTH) {\n                        length = MAX_BLOB_LENGTH;\n                        log.warn(\n                                \"The length of blob type {} is out of range, \"\n                                        + \"it will be converted to {}({})\",\n                                column.getName(),\n                                DB2_BLOB,\n                                length);\n                    }\n                    builder.columnType(String.format(\"%s(%s)\", DB2_BLOB, length));\n                    builder.dataType(DB2_BLOB);\n                    builder.length(length);\n                }\n                break;\n            case STRING:\n                if (column.getColumnLength() == null || column.getColumnLength() <= 0) {\n                    builder.columnType(String.format(\"%s(%s)\", DB2_VARCHAR, MAX_VARCHAR_LENGTH));\n                    builder.dataType(DB2_VARCHAR);\n                    builder.length(column.getColumnLength());\n                } else if (column.getColumnLength() <= MAX_CHAR_LENGTH) {\n                    builder.columnType(String.format(\"%s(%s)\", DB2_CHAR, column.getColumnLength()));","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/db2/DB2TypeConverter.java#L325-L361","documentation":"When converting a binary/BLOB-typed column back to DB2 DDL, if the declared length exceeds DB2's maximum BLOB size (MAX_BLOB_LENGTH = 2147483647 bytes, 2GB-1), the converter clamps it to the maximum and logs this warning, emitting BLOB(max). DB2 cannot create a BLOB larger than its limit, so the oversized length is silently reduced.","triggerScenarios":"reconvert processes a BytesType/binary column whose getColumnLength() is greater than 2147483647, e.g. from sources declaring LONGTEXT/BLOB sizes as Long.MAX_VALUE or 4GB+ lengths.","commonSituations":"Syncing MySQL LONGBLOB (interpreted as ~4GB) into DB2; connectors that report unknown length as Long.MAX_VALUE; schema files with hand-entered giant lengths.","solutions":["Cap the column length in the source/schema to <= 2147483647 bytes","Accept the clamped BLOB(2147483647) and verify no rows will exceed 2GB-1","Use a transform or upstream filtering to exclude rows larger than the DB2 BLOB limit","If larger objects are required, store them externally (object storage) and keep references in the table"],"exampleFix":"// before (source schema)\nBytesType(length = 4294967295)\n// after (clamped to DB2 max)\nBytesType(length = 2147483647) // BLOB(2147483647)","handlingStrategy":"validation","validationCode":"// before write\nlong len = column.getColumnLength();\nif (len > 2147483647L) {\n    throw new IllegalArgumentException(\"BLOB length \" + len + \" exceeds DB2 max 2147483647 for column \" + column.getName());\n}","typeGuard":"boolean fitsDb2Blob(long length) {\n    return length <= 2147483647L;\n}","tryCatchPattern":null,"preventionTips":["Cap binary column lengths at 2GB-1 for DB2 sinks","Don't model 'unlimited' as Long.MAX_VALUE length","Store oversized objects externally if they may exceed 2GB"],"tags":["jdbc","db2","blob","length-limit"],"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"}