{"record":{"id":"51728a57e17ca5be","repo":"apache/seatunnel","slug":"the-time-column-type-time-is-out-of-range-51728a","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/xugu/XuguTypeConverter.java","lineNumber":349,"sourceCode":"                    builder.columnType(\n                            String.format(\"%s(%s)\", XUGU_VARCHAR, column.getColumnLength()));\n                    builder.dataType(XUGU_VARCHAR);\n                } else {\n                    builder.columnType(XUGU_CLOB);\n                    builder.dataType(XUGU_CLOB);\n                }\n                break;\n            case DATE:\n                builder.columnType(XUGU_DATE);\n                builder.dataType(XUGU_DATE);\n                break;\n            case TIME:\n                builder.dataType(XUGU_TIME);\n                if (column.getScale() != null && column.getScale() > 0) {\n                    Integer timeScale = column.getScale();\n                    if (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(String.format(\"%s(%s)\", XUGU_TIME, timeScale));\n                    builder.scale(timeScale);\n                } else {\n                    builder.columnType(XUGU_TIME);\n                }\n                break;\n            case TIMESTAMP:\n                if (column.getScale() == null || column.getScale() <= 0) {\n                    builder.columnType(XUGU_TIMESTAMP);\n                } else {","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/xugu/XuguTypeConverter.java#L331-L367","documentation":"This is a warning logged by XuguTypeConverter.reconvert when a SeaTunnel TIME column declares a fractional-second scale greater than the maximum supported by XuGu (MAX_TIME_SCALE). The converter clamps the scale down and proceeds; it does not throw. It exists so users know precision will be silently truncated when mapping to XUGU_TIME.","triggerScenarios":"Catalog-based sink write to XuGu where the incoming SeaTunnel column is TIME with scale > MAX_TIME_SCALE (e.g. time(9) sourced from a high-precision upstream), so reconvert must clamp the scale.","commonSituations":"Copying TIME columns from MySQL/PostgreSQL with microsecond or nanosecond precision into XuGu, which supports fewer fractional digits; upstream schema auto-evolution propagating an over-precise time type.","solutions":["Reduce the source TIME scale to <= MAX_TIME_SCALE in the upstream table or in a Transform (e.g. cast/substring the time value).","Let the converter clamp the scale (it is only a warning) and verify truncated precision is acceptable.","Declare the column with an explicit smaller scale in your catalog table definition."],"exampleFix":"// before: source column time(9)\n// after: cast the column before the sink\nSQL: CAST(time_col AS TIME(3)) AS time_col","handlingStrategy":"validation","validationCode":"if (col.getSqlType() == SqlType.TIME && col.getColumnScale() > MAX_TIME_SCALE) {\n    col = col.copy().setColumnScale(MAX_TIME_SCALE).build(); // clamp proactively\n}","typeGuard":"boolean withinTimeScale(ColumnType c) { return c.getScale() == null || c.getScale() <= MAX_TIME_SCALE; }","tryCatchPattern":null,"preventionTips":["Check MAX_TIME_SCALE in XuguTypeConverter before defining TIME columns","Cast high-precision time columns at the source","Review connector logs for out-of-range warnings after schema sync"],"tags":["jdbc","xugu","type-conversion","precision-loss"],"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"}