{"record":{"id":"ac430ba9509d5b71","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-ac430b","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-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/xugu/XuguTypeConverter.java","lineNumber":287,"sourceCode":"                            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(),\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,","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/xugu/XuguTypeConverter.java#L269-L305","documentation":"XuguTypeConverter.reconvert clamps negative decimal scale to 0. If a SeaTunnel DecimalType has scale < 0 (possible after precision-shrinking arithmetic or invalid upstream declarations), the converter logs this warning and forces scale = 0, discarding the fractional part semantics.","triggerScenarios":"Sink catalog conversion where a DecimalType ends with negative scale — either declared directly or resulting from the precision > MAX_PRECISION adjustment in the same method.","commonSituations":"Upstream mappers that compute scale = original_scale - (precision - max_precision) overshooting below zero; hand-built DecimalType with negative scale.","solutions":["Ensure declared scale is >= 0 on the source DecimalType","Check upstream mapper arithmetic; reduce precision less aggressively or pre-cast the column","Accept integer-only (scale 0) semantics if fractions are not needed"],"exampleFix":"// before\nDecimalType d = new DecimalType(10, -2); // scale clamped to 0\n// after\nDecimalType d = new DecimalType(10, 0);","handlingStrategy":"validation","validationCode":"if (decimalType.getScale() < 0) {\n    throw new IllegalArgumentException(\"Column \" + column.getName() + \" decimal scale must be >= 0\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reject negative scales at pipeline-construction time","Review precision-shrinking arithmetic in upstream mappers","Use DECIMAL with explicit non-negative scale in transforms","Test catalog conversion for decimal columns after mapper changes"],"tags":["jdbc","xugu","decimal","scale"],"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-14T11:17:12.474Z"}