{"record":{"id":"ff2ec202e8dcd974","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-ff2ec2","errorCode":null,"errorMessage":"The decimal column {} type decimal({},{}) is out of range, which exceeds the maximum precision of {}, it will be converted to decimal({},{})","messagePattern":"The decimal column (.+?) type decimal\\((.+?),(.+?)\\) is out of range, which exceeds the maximum precision 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":384,"sourceCode":"                DecimalType decimalType = (DecimalType) column.getDataType();\n                long precision = decimalType.getPrecision();\n                int scale = decimalType.getScale();\n                if (precision <= 0) {\n                    precision = DEFAULT_PRECISION;\n                    scale = DEFAULT_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                    scale = (int) Math.max(0, scale - (precision - MAX_PRECISION));\n                    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 decimal({},{})\",\n                            column.getName(),\n                            decimalType.getPrecision(),\n                            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(),","sourceCodeStart":366,"sourceCodeEnd":402,"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#L366-L402","documentation":"In MaxComputeTypeConverter.reconvert, when the SeaTunnel decimal precision exceeds MAX_PRECISION, the converter trims the scale by the excess (scale -= precision - MAX_PRECISION, floored at 0), caps precision at MAX_PRECISION, and logs this warning. Values with more integer digits than the capped precision will overflow.","triggerScenarios":"reconvert called with a DecimalType whose precision is greater than MAX_PRECISION, e.g. decimal(45, 10) being converted back to a MaxCompute decimal type.","commonSituations":"Sinks declaring very wide decimals; aggregated decimal results whose precision grew beyond MaxCompute limits; mismatches between source and sink decimal capabilities.","solutions":["Cap the column precision in the pipeline before the sink (cast to a supported precision)","Adjust the sink schema to decimal(MAX_PRECISION, scale)","If fractional digits are lost due to scale trimming, reduce the source scale explicitly (e.g. CAST to decimal(38,8))","Verify whether the truncated scale loses needed fractional digits and add rounding upstream"],"exampleFix":"// before\nnew DecimalType(45, 10) // exceeds MAX_PRECISION, scale trimmed\n// after\nnew DecimalType(38, 3) // CAST upstream to fit","handlingStrategy":"validation","validationCode":"DecimalType dt = (DecimalType) column.getDataType();\nif (dt.getPrecision() > 38) {\n    int newScale = (int) Math.max(0, dt.getScale() - (dt.getPrecision() - 38));\n    System.out.println(\"Column will become decimal(38,\" + newScale + \"), fractional digits may be lost\");\n}","typeGuard":"if (column.getDataType() instanceof DecimalType dt) { return dt.getPrecision() <= 38; } return true;","tryCatchPattern":null,"preventionTips":["Cap decimal precision at 38 in pipeline schemas","Account for scale trimming when precision exceeds the max","CAST oversized decimals upstream with an explicit target precision/scale"],"tags":["maxcompute","decimal","precision","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"}