{"record":{"id":"781db945ae1b8adc","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-781db9","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-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/utils/RowTypeConverter.java","lineNumber":352,"sourceCode":"                                precision,\n                                scale);\n                    } else if (precision > DecimalType.MAX_PRECISION) {\n                        scale = (int) Math.max(0, scale - (precision - DecimalType.MAX_PRECISION));\n                        precision = DecimalType.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                                seatunnelDecimalType.getPrecision(),\n                                seatunnelDecimalType.getScale(),\n                                DecimalType.MAX_PRECISION,\n                                precision,\n                                scale);\n                    }\n                    if (scale < 0) {\n                        scale = DecimalType.DEFAULT_SCALE;\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                                seatunnelDecimalType.getPrecision(),\n                                seatunnelDecimalType.getScale(),\n                                precision,\n                                scale);\n                    } else if (scale > DecimalType.MAX_PRECISION) {\n                        scale = DecimalType.MAX_PRECISION;\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                                seatunnelDecimalType.getPrecision(),\n                                seatunnelDecimalType.getScale(),\n                                DecimalType.MAX_PRECISION,","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/utils/RowTypeConverter.java#L334-L370","documentation":"RowTypeConverter decimal visit: a negative scale is invalid for Paimon decimal columns, so the converter resets scale to DecimalType.DEFAULT_SCALE (precision already fixed) and warns that the type was rewritten.","triggerScenarios":"Column declared decimal(p,-n) (negative scale, allowed in some engines for rounding to tens/hundreds) when converting to Paimon row type.","commonSituations":"Oracle NUMBER(p,-n) style columns; upstream frameworks emitting negative scale after their own clamping; manually written schema decimal(10,-2).","solutions":["Remove negative scale from the declared type; model rounding in a transform if needed.","Cast the column to a positive-scale decimal (or string) before the Paimon sink.","Confirm DEFAULT_SCALE output still represents your values; otherwise widen precision explicitly.","Fix the source connector type mapping that produced the negative scale."],"exampleFix":"// before\nDECIMAL(10,-2)\n// after\nDECIMAL(10,0)  // or apply ROUND in a transform first","handlingStrategy":"validation","validationCode":"if (decimalType.getScale() < 0) decimalType = new DecimalType(decimalType.getPrecision(), 0);","typeGuard":"boolean hasNonNegativeScale(DecimalType t) { return t.getScale() >= 0; }","tryCatchPattern":null,"preventionTips":["Avoid negative-scale NUMBER types from Oracle-style sources","Model rounding in transforms","Validate schema before job submission"],"tags":["paimon","decimal","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-23T08:17:48.524Z"}