{"record":{"id":"db55cefa0b688695","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-db55ce","errorCode":null,"errorMessage":"The decimal column {} type decimal({},{}) is out of range, which exceeds the maximum scale of {}, it will be converted to decimal({},{})","messagePattern":"The decimal column (.+?) type decimal\\((.+?),(.+?)\\) is out of range, which exceeds the maximum scale of (.+?), it will be converted to decimal\\((.+?),(.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/datatype/MaxComputeTypeConverter.java","lineNumber":408,"sourceCode":"                            decimalType.getScale(),\n                            MAX_PRECISION,\n                            precision,\n                            scale);\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 > MAX_SCALE) {\n                    scale = MAX_SCALE;\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                            MAX_SCALE,\n                            precision,\n                            scale);\n                }\n\n                String decimalTypeStr = String.format(\"%s(%s,%s)\", DECIMAL, precision, scale);\n                builder.nativeType(TypeInfoFactory.getDecimalTypeInfo((int) precision, scale));\n                builder.columnType(decimalTypeStr);\n                builder.dataType(DECIMAL);\n                builder.precision(precision);\n                builder.scale(scale);\n                break;","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/datatype/MaxComputeTypeConverter.java#L390-L426","documentation":"In MaxComputeTypeConverter.reconvert, when the SeaTunnel decimal scale exceeds MAX_SCALE, the converter caps scale at MAX_SCALE (precision unchanged) and logs this warning. Extra fractional digits beyond MAX_SCALE will be truncated/rounded, causing precision loss on write.","triggerScenarios":"reconvert called with a DecimalType whose scale is greater than MAX_SCALE, e.g. decimal(38, 25) where the connector caps scale lower.","commonSituations":"High-precision financial data; upstream multiplication/division raising scale; declaring decimal with more fractional digits than MaxCompute/connector supports.","solutions":["Round upstream to fewer fractional digits (e.g. CAST(col AS DECIMAL(38,18))) before the sink","Change the sink schema scale to MAX_SCALE explicitly","If full fractional precision is required, use a STRING column instead of DECIMAL","Confirm the truncation rounding behavior matches business expectations"],"exampleFix":"// before\nnew DecimalType(38, 25) // scale exceeds MAX_SCALE, truncated\n// after\nCAST(col AS DECIMAL(38, 18)) AS col","handlingStrategy":"validation","validationCode":"DecimalType dt = (DecimalType) column.getDataType();\nif (dt.getScale() > 18) System.out.println(\"Column \" + column.getName() + \" scale will be truncated; round upstream\");","typeGuard":"if (column.getDataType() instanceof DecimalType dt) { return dt.getScale() <= 18; } return true;","tryCatchPattern":null,"preventionTips":["Limit decimal scale in pipeline schemas to the supported max","Round high-precision results upstream before the sink","Use STRING columns when full fractional precision must be preserved"],"tags":["maxcompute","decimal","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"}