{"record":{"id":"434fa0ee11a77341","repo":"apache/seatunnel","slug":"the-time-column-type-time-is-out-of-range-434fa0","errorCode":null,"errorMessage":"The time column {} type time({}) is out of range, which exceeds the maximum scale of {}, it will be converted to time({})","messagePattern":"The time column (.+?) type time\\((.+?)\\) is out of range, which exceeds the maximum scale of (.+?), it will be converted to time\\((.+?)\\)","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":346,"sourceCode":"                } 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(),\n                            MAX_SCALE,\n                            timeScale);\n                }\n                builder.columnType(REDSHIFT_TIME);\n                builder.dataType(REDSHIFT_TIME);\n                builder.scale(timeScale);\n                break;\n            case TIMESTAMP:\n                Integer timestampScale = column.getScale();\n                if (timestampScale != null && timestampScale > MAX_TIMESTAMP_SCALE) {\n                    timestampScale = MAX_TIMESTAMP_SCALE;\n                    log.warn(\n                            \"The timestamp column {} type timestamp({}) is out of range, \"","sourceCodeStart":328,"sourceCodeEnd":364,"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#L328-L364","documentation":"WARN log from RedshiftTypeConverter.reconvert for TIME columns. If the column's declared fractional-second scale exceeds MAX_TIME_SCALE, the converter caps it at the maximum and logs this warning; the generated time(p) DDL uses the clamped scale. Sub-second precision beyond the cap is lost.","triggerScenarios":"Sink-side auto table creation where a TIME column has getScale() > MAX_TIME_SCALE; raised in reconvert() during TIME case handling.","commonSituations":"Sources with nanosecond-precision times (e.g. some databases or data formats with scale 9) written to Redshift, which supports fewer fractional digits.","solutions":["Round/truncate the time scale in the source or a transform to <= MAX_TIME_SCALE","Pre-create the Redshift table with the exact time(p) precision you want","Accept the conversion if losing sub-second precision is acceptable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (col.getScale() != null && col.getScale() > maxTimeScale) {\n    // cast time column to time(maxTimeScale) upstream\n}","typeGuard":"boolean timeScaleFits(Integer scale, int max) { return scale == null || scale <= max; }","tryCatchPattern":null,"preventionTips":["Know target DB max fractional-second precision before designing the pipeline","Cast TIME columns to supported scale in a transform","Pre-create tables with exact time(p) definitions"],"tags":["jdbc","redshift","type-conversion","time-scale"],"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"}