{"record":{"id":"0cea9df535f06a27","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-0cea9d","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/yashandb/YashanDbTypeConverter.java","lineNumber":383,"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":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbTypeConverter.java#L365-L401","documentation":"Warning from YashanDbTypeConverter.reconvert when a DECIMAL column's scale is negative, which is invalid for YashanDB. The converter sets scale to 0 and continues, turning the column into an integer-valued decimal; only this warning is logged.","triggerScenarios":"Sink write of a DecimalType with negative scale (e.g. DECIMAL(10,-3), produced by some engines to mean rounding to thousands) into YashanDB.","commonSituations":"Schemas coming from engines that permit negative scale (Spark/Hive-style decimal(10,-3)); metadata round-trips that preserve negative scale.","solutions":["Remove the negative scale at the source: CAST(col AS DECIMAL(10,0)).","Accept the scale=0 conversion if truncation of the rounded value semantics is acceptable.","Define the YashanDB target column explicitly as DECIMAL(p,0)."],"exampleFix":"// before: decimal(10,-3)\n// after\nSQL: CAST(col AS DECIMAL(10,0)) AS col","handlingStrategy":"validation","validationCode":"DecimalType d = (DecimalType) col.getDataType();\nif (d.getScale() < 0) {\n    col = col.copy().setDataType(new DecimalType(d.getPrecision(), 0)).build();\n}","typeGuard":"boolean nonNegativeScale(DecimalType d) { return d.getScale() >= 0; }","tryCatchPattern":null,"preventionTips":["Avoid engines/configs that emit negative-scale decimals for target schemas","Cast decimal(10,-3) to decimal(10,0) upstream","Review source table DDL during pipeline design"],"tags":["jdbc","yashandb","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"}