{"record":{"id":"33e3fef889128c8b","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-33e3fe","errorCode":null,"errorMessage":"The decimal column {} type decimal({},{}) is out of range, which is precision less than 0, it will be converted to decimal({},{})","messagePattern":"The decimal column (.+?) type decimal\\((.+?),(.+?)\\) is out of range, which is precision 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":241,"sourceCode":"            case DOUBLE:\n                builder.columnType(SR_DOUBLE);\n                builder.dataType(SR_DOUBLE);\n                break;\n            case DECIMAL:\n                // DORIS LARGEINT\n                if (column.getSourceType() != null\n                        && column.getSourceType().equalsIgnoreCase(SR_LARGEINT)) {\n                    builder.dataType(SR_LARGEINT);\n                    builder.columnType(SR_LARGEINT);\n                    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);","sourceCodeStart":223,"sourceCodeEnd":259,"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#L223-L259","documentation":"During schema re-conversion to StarRocks types, a decimal column whose precision is <= 0 is invalid. The connector logs this warning and silently coerces the type to decimal(MAX_PRECISION, MAX_SCALE) instead of failing.","triggerScenarios":"reconvert() (via keyColumnType/valueColumnType) receives a CatalogTable column whose DecimalType has precision <= 0.","commonSituations":"Upstream metadata returning uninitialized/placeholder decimal precision; programmatic schema construction with unset precision; source systems reporting decimals with precision 0.","solutions":["Inspect the source table schema and fix the column to a valid decimal(p,s) with precision >= 1","Explicitly define the sink schema with a correct decimal precision instead of relying on auto-conversion","If intentional, accept the widened decimal(38, 9)-style default and verify values still fit"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (dt instanceof DecimalType) {\n  DecimalType d = (DecimalType) dt;\n  if (d.getPrecision() <= 0) throw new IllegalArgumentException(\n    \"Column \" + col.getName() + \" has invalid decimal precision \" + d.getPrecision());\n}","typeGuard":"boolean hasValidDecimal(Column c) {\n  return !(c.getDataType() instanceof DecimalType)\n      || ((DecimalType) c.getDataType()).getPrecision() > 0;\n}","tryCatchPattern":null,"preventionTips":["Validate source schema decimals before job submission","Explicitly declare sink schema decimals instead of relying on auto conversion"],"tags":["decimal","schema","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-14T05:17:10.506Z"}