{"record":{"id":"47908f85d874b68a","repo":"apache/seatunnel","slug":"the-timestamp-column-type-timestamp-is-out-47908f","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/phoenix/PhoenixTypeConverter.java","lineNumber":310,"sourceCode":"                                    + \"it will be converted to time({})\",\n                            column.getName(),\n                            column.getScale(),\n                            MAX_SCALE,\n                            timeScale);\n                }\n                if (timeScale != null && timeScale > 0) {\n                    builder.columnType(String.format(\"%s(%s)\", PHOENIX_TIME, timeScale));\n                } else {\n                    builder.columnType(PHOENIX_TIME);\n                }\n                builder.dataType(PHOENIX_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, \"\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                if (timestampScale != null && timestampScale > 0) {\n                    builder.columnType(String.format(\"%s(%s)\", PHOENIX_TIMESTAMP, timestampScale));\n                } else {\n                    builder.columnType(PHOENIX_TIMESTAMP);\n                }\n                builder.dataType(PHOENIX_TIMESTAMP);\n                builder.scale(timestampScale);\n                break;\n            case ARRAY:\n                ArrayType arrayType = (ArrayType) column.getDataType();","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/phoenix/PhoenixTypeConverter.java#L292-L328","documentation":"When converting a TIMESTAMP column to the Phoenix type, a scale greater than MAX_TIMESTAMP_SCALE cannot be represented, so the converter logs this warning and clamps the timestamp scale to MAX_TIMESTAMP_SCALE. Fractional-second digits beyond the limit are truncated when data is written.","triggerScenarios":"PhoenixTypeConverter.reconvert() on a CatalogColumn of type TIMESTAMP with a non-null scale exceeding MAX_TIMESTAMP_SCALE (e.g. TIMESTAMP(9) nanosecond timestamps).","commonSituations":"Nanosecond-precision timestamps from sources like certain databases or event streams being sunk to Phoenix, which caps fractional-second precision.","solutions":["Lower the timestamp scale in the source/catalog to within MAX_TIMESTAMP_SCALE.","CAST the column upstream, e.g. CAST(ts AS TIMESTAMP(3)), before the Phoenix sink.","Check the warning to confirm the applied precision suffices for your data.","Choose a sink supporting nanosecond precision if truncation is unacceptable."],"exampleFix":"// before\ncatalogColumn = CatalogColumn.of(\"ts\", TimestampType(9));\n// after\ncatalogColumn = CatalogColumn.of(\"ts\", TimestampType(3));","handlingStrategy":"validation","validationCode":"Integer scale = col.getScale();\nif (col.getDataType() instanceof TimestampType && scale != null && scale > maxTimestampScale) {\n    col = CatalogColumn.of(col.getName(), new TimestampType(maxTimestampScale), col.isNullable(), col.getDefaultValue());\n}","typeGuard":"boolean fitsPhoenixTimestampScale(CatalogColumn c) {\n    Integer s = c.getScale();\n    return !(c.getDataType() instanceof TimestampType) || s == null || s <= 3;\n}","tryCatchPattern":null,"preventionTips":["Cast TIMESTAMP(9) columns to TIMESTAMP(3) before sinking to Phoenix","Store nanosecond timestamps as epoch-nanos BIGINT if precision is required","Review Phoenix type limits when designing event-time schemas"],"tags":["jdbc","phoenix","timestamp","scale","type-conversion"],"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"}