{"record":{"id":"c087cbfe0f26b294","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-c087cb","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-doris/src/main/java/org/apache/seatunnel/connectors/doris/datatype/AbstractDorisTypeConverter.java","lineNumber":354,"sourceCode":"                }\n\n                if (scale > getMaxDecimalScale()) {\n                    log.warn(\n                            \"The decimal column {} type decimal({},{}) is out of range, \"\n                                    + \"which exceeds the maximum scale of {} supported by this \"\n                                    + \"Doris version, it will be converted to decimal({},{})\",\n                            column.getName(),\n                            decimalType.getPrecision(),\n                            decimalType.getScale(),\n                            getMaxDecimalScale(),\n                            precision,\n                            getMaxDecimalScale());\n                    scale = getMaxDecimalScale();\n                }\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 > precision) {\n                    scale = 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                            decimalType.getPrecision(),\n                            decimalType.getScale(),\n                            precision,","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/datatype/AbstractDorisTypeConverter.java#L336-L372","documentation":"sampleReconvert detects a decimal column whose scale is negative (after prior clamping). Negative scale is invalid, so the converter warns, sets scale to 0, and converts the column to decimal(precision, 0), turning it into an integer-valued decimal.","triggerScenarios":"sampleReconvert encounters DecimalType with getScale() < 0 (or a scale that became negative after precision-based adjustments) while mapping the Doris schema back to SeaTunnel types.","commonSituations":"Schema metadata from other systems allowing negative scale (e.g. Oracle NUMBER(p,-s)); hand-written or generated type definitions with negative scale.","solutions":["Redeclare the column with a non-negative scale in Doris","If the negative scale was intentional (e.g. Oracle-style thousands rounding), pre-round values in a transform since the fallback makes scale 0","Accept the decimal(p,0) fallback if integer-valued decimals suffice"],"exampleFix":"// before: DecimalType precision=10, scale=-2\n// after: converter uses decimal(10,0); upstream declare\nDECIMAL(10,0) -- or pre-round values in a transform","handlingStrategy":"validation","validationCode":"if (decimalType.getScale() < 0) {\n    // redeclare as DECIMAL(p,0) or pre-round values upstream\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid copying Oracle-style negative-scale NUMBER definitions verbatim","Pre-round values in a transform if negative-scale rounding semantics are required","Validate generated schema definitions before job submission"],"tags":["doris","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-14T11:17:12.474Z"}