{"record":{"id":"fa4e794a69c46f0b","repo":"apache/seatunnel","slug":"the-timestamp-column-type-timestamp-is-out","errorCode":null,"errorMessage":"The timestamp column {} type timestamp({}) is out of range, which exceeds the maximum scale of {}, it will be converted to timestamp({})","messagePattern":"The timestamp column (.+?) type timestamp\\((.+?)\\) is out of range, which exceeds the maximum scale of (.+?), it will be converted to timestamp\\((.+?)\\)","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":398,"sourceCode":"                    builder.columnType(String.format(\"%s(%s)\", DB2_CLOB, length));\n                    builder.dataType(DB2_CLOB);\n                    builder.length(length);\n                }\n                break;\n            case DATE:\n                builder.columnType(DB2_DATE);\n                builder.dataType(DB2_DATE);\n                break;\n            case TIME:\n                builder.columnType(DB2_TIME);\n                builder.dataType(DB2_TIME);\n                break;\n            case TIMESTAMP:\n                if (column.getScale() != null && column.getScale() > 0) {\n                    int timestampScale = column.getScale();\n                    if (column.getScale() > MAX_TIMESTAMP_SCALE) {\n                        timestampScale = MAX_TIMESTAMP_SCALE;\n                        log.warn(\n                                \"The timestamp column {} type timestamp({}) is out of range, \"\n                                        + \"which exceeds the maximum scale of {}, \"\n                                        + \"it will be converted to timestamp({})\",\n                                column.getName(),\n                                column.getScale(),\n                                MAX_TIMESTAMP_SCALE,\n                                timestampScale);\n                    }\n                    builder.columnType(String.format(\"%s(%s)\", DB2_TIMESTAMP, timestampScale));\n                    builder.scale(timestampScale);\n                } else {\n                    builder.columnType(DB2_TIMESTAMP);\n                }\n                builder.dataType(DB2_TIMESTAMP);\n                break;\n            default:\n                throw CommonError.convertToConnectorTypeError(\n                        DatabaseIdentifier.DB_2,","sourceCodeStart":380,"sourceCodeEnd":416,"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#L380-L416","documentation":"DB2 timestamps support a fractional-seconds precision up to 12 digits (MAX_TIMESTAMP_SCALE = 12). When reconvert finds a TIMESTAMP column whose scale exceeds 12, it clamps the scale to 12 and logs this warning, converting to timestamp(12). Extra nanosecond precision beyond 12 digits will be truncated.","triggerScenarios":"reconvert processes a column with SqlType.TIMESTAMP and a non-null scale > 12, e.g. sources with TIMESTAMP(13+) or nanosecond-precision types from other databases.","commonSituations":"Syncing nanosecond-precision timestamps (e.g. some Postgres/other engines or app-level types) into DB2; auto-generated schemas carrying source-native max precision; schema evolution copying precision verbatim.","solutions":["Reduce the source timestamp precision to <= 12 fractional digits","Accept the clamped timestamp(12) if sub-12-digit truncation is acceptable","Round timestamps in a transform before the sink to control truncation behavior","Pick a sink database that supports the required precision if exactness matters"],"exampleFix":"// before\nTIMESTAMP(15)\n// after (DB2-compatible)\nTIMESTAMP(12)","handlingStrategy":"validation","validationCode":"// before write\nInteger scale = column.getScale();\nif (scale != null && scale > 12) {\n    throw new IllegalArgumentException(\"Timestamp scale \" + scale + \" exceeds DB2 max 12 for column \" + column.getName());\n}","typeGuard":"boolean fitsDb2Timestamp(Integer scale) {\n    return scale == null || scale <= 12;\n}","tryCatchPattern":null,"preventionTips":["Limit timestamp fractional precision to 12 for DB2 sinks","Round/normalize nanosecond timestamps before writing","Check source timestamp precision during pipeline design, not at runtime"],"tags":["jdbc","db2","timestamp","precision"],"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"}