{"record":{"id":"461770390684ad79","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-461770","errorCode":null,"errorMessage":"The decimal column {} type decimal({},{}) is out of range, which is scale less than 0, it will be converted to decimal({},{})","messagePattern":"The decimal column (.+?) type decimal\\((.+?),(.+?)\\) is out of range, which is scale less than 0, it will be converted to decimal\\((.+?),(.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/datatypes/StarRocksTypeConverter.java","lineNumber":266,"sourceCode":"                            precision,\n                            scale);\n                } else if (precision > MAX_PRECISION) {\n                    log.warn(\n                            \"The decimal column {} type decimal({},{}) is out of range, \"\n                                    + \"which exceeds the maximum precision of {}, \"\n                                    + \"it will be converted to varchar(200)\",\n                            column.getName(),\n                            decimalType.getPrecision(),\n                            decimalType.getScale(),\n                            MAX_PRECISION);\n                    builder.dataType(SR_VARCHAR);\n                    builder.columnType(String.format(\"%s(%s)\", SR_VARCHAR, 200));\n                    break;\n                }\n\n                if (scale < 0) {\n                    scale = 0;\n                    log.warn(\n                            \"The decimal column {} type decimal({},{}) is out of range, \"\n                                    + \"which is scale less than 0, \"\n                                    + \"it will be converted to decimal({},{})\",\n                            column.getName(),\n                            decimalType.getPrecision(),\n                            decimalType.getScale(),\n                            precision,\n                            scale);\n                } else if (scale > precision) {\n                    scale = precision;\n                    log.warn(\n                            \"The decimal column {} type decimal({},{}) is out of range, \"\n                                    + \"which exceeds the maximum scale of {}, \"\n                                    + \"it will be converted to decimal({},{})\",\n                            column.getName(),\n                            decimalType.getPrecision(),\n                            decimalType.getScale(),\n                            precision,","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/datatypes/StarRocksTypeConverter.java#L248-L284","documentation":"WARN logged by StarRocksTypeConverter.reconvert when a DECIMAL column's precision exceeds the connector maximum; depending on branch the type is adjusted or degraded (e.g. varchar(200)) and the resulting type is emitted. Type-adjustment warning only.","triggerScenarios":"reconvert() (via keyColumnType/valueColumnType) receives a DecimalType whose scale is < 0 (allowed by some engines to mean rounding to powers of ten).","commonSituations":"Sources like newer SQL Server / Postgres semantics allowing negative scale (numeric(p,-3)); hand-built schemas with placeholder scale -1.","solutions":["Redefine the source column with a non-negative scale","Cast the column in a transform to a plain decimal(p,0) before sinking","If rounding at powers of ten matters, do explicit rounding in a transform, since scale is clamped to 0"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (dt instanceof DecimalType) {\n  DecimalType d = (DecimalType) dt;\n  if (d.getScale() < 0) throw new IllegalArgumentException(\n    \"Column \" + col.getName() + \" has negative decimal scale \" + d.getScale());\n}","typeGuard":"boolean hasNonNegativeScale(Column c) {\n  return !(c.getDataType() instanceof DecimalType)\n      || ((DecimalType) c.getDataType()).getScale() >= 0;\n}","tryCatchPattern":null,"preventionTips":["Normalize negative-scale numerics at the source with ROUND/cast","Document any engine-specific negative scale semantics before migrating"],"tags":["decimal","scale","type-conversion","starrocks"],"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"}