{"record":{"id":"573ef217658423ec","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-573ef2","errorCode":null,"errorMessage":"The decimal column {} type decimal({},{}) is out of range, which exceeds the maximum precision of {}, it will be converted to varchar(200)","messagePattern":"The decimal column (.+?) type decimal\\((.+?),(.+?)\\) is out of range, which exceeds the maximum precision of (.+?), it will be converted to varchar\\(200\\)","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":251,"sourceCode":"                    break;\n                }\n                DecimalType decimalType = (DecimalType) column.getDataType();\n                int precision = decimalType.getPrecision();\n                int scale = decimalType.getScale();\n                if (precision <= 0) {\n                    precision = MAX_PRECISION.intValue();\n                    scale = MAX_SCALE;\n                    log.warn(\n                            \"The decimal column {} type decimal({},{}) is out of range, \"\n                                    + \"which is precision 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 (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({},{})\",","sourceCodeStart":233,"sourceCodeEnd":269,"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#L233-L269","documentation":"When converting schemas to StarRocks types, a decimal column whose precision exceeds StarRocks' maximum precision (38) cannot be represented. The connector logs this warning and degrades the column to varchar(200), which may truncate or break arithmetic semantics.","triggerScenarios":"reconvert() (via keyColumnType/valueColumnType) encounters a DecimalType with precision > MAX_PRECISION (38).","commonSituations":"Source databases with decimal(50,x) or huge-precision numeric columns (e.g. Oracle NUMBER with large precision); schema evolved upstream to bigger precision after job design.","solutions":["Reduce the source column precision to <= 38 (e.g. ALTER TABLE or cast in the source query)","Add a transform to cast the column to a supported decimal(38,s) before the StarRocks sink","Note the varchar(200) degradation: if values exceed 200 chars or need numeric semantics, redesign the mapping explicitly"],"exampleFix":"// before (source decimal(65,10) silently becomes varchar(200))\n// after: cast in transform\nSqlTransform: cast(a as decimal(38,10)) as a","handlingStrategy":"validation","validationCode":"if (dt instanceof DecimalType) {\n  DecimalType d = (DecimalType) dt;\n  if (d.getPrecision() > 38) throw new IllegalArgumentException(\n    \"Column \" + col.getName() + \" decimal precision \" + d.getPrecision() + \" exceeds StarRocks max 38\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit source schemas for precision > 38 decimals","Add upstream casts to decimal(38,s) in the pipeline","Remember varchar(200) fallback can truncate; never rely on it for numeric columns"],"tags":["decimal","precision","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"}