{"record":{"id":"14e135cef7fcbd23","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-14e135","errorCode":null,"errorMessage":"The decimal column {} type decimal({},{}) is out of range, which is precision less than 0, it will be converted to decimal({},{})","messagePattern":"The decimal column (.+?) type decimal\\((.+?),(.+?)\\) is out of range, which is precision less than 0, 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":372,"sourceCode":"                break;\n            case FLOAT:\n                builder.nativeType(TypeInfoFactory.getPrimitiveTypeInfo(OdpsType.FLOAT));\n                builder.columnType(FLOAT);\n                builder.dataType(FLOAT);\n                break;\n            case DOUBLE:\n                builder.nativeType(TypeInfoFactory.getPrimitiveTypeInfo(OdpsType.DOUBLE));\n                builder.columnType(DOUBLE);\n                builder.dataType(DOUBLE);\n                break;\n            case DECIMAL:\n                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(),","sourceCodeStart":354,"sourceCodeEnd":390,"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#L354-L390","documentation":"MaxComputeTypeConverter.reconvert maps a SeaTunnel DecimalType column back to a MaxCompute decimal. A SeaTunnel decimal with precision <= 0 is invalid for MaxCompute, so the converter logs this warning and substitutes decimal(DEFAULT_PRECISION, DEFAULT_SCALE).","triggerScenarios":"Calling reconvert on a CatalogColumn whose DecimalType has precision <= 0 (e.g. an unbounded/undefined decimal from upstream transforms or a bad schema definition).","commonSituations":"Upstream CDC/transform pipelines declaring DECIMAL without precision; schema inference producing decimal(0,0); hand-edited schema JSON.","solutions":["Fix the upstream schema to declare an explicit positive precision (e.g. decimal(38,10))","Validate column types before writing to MaxCompute (reject precision <= 0 early)","If the warning is expected, confirm the default decimal(p,s) substitution is acceptable","Patch the producing component to never emit non-positive decimal precision"],"exampleFix":"// before\nnew DecimalType(0, 0) // triggers reconvert warning\n// after\nnew DecimalType(38, 10)","handlingStrategy":"validation","validationCode":"// validate SeaTunnel column before sink write\nDecimalType dt = (DecimalType) column.getDataType();\nif (dt.getPrecision() <= 0) throw new IllegalArgumentException(\"Column \" + column.getName() + \" needs explicit decimal precision\");","typeGuard":"if (column.getDataType() instanceof DecimalType dt) { return dt.getPrecision() > 0; } return false;","tryCatchPattern":null,"preventionTips":["Always declare DECIMAL with explicit precision/scale in upstream schemas","Reject unbounded decimals in schema validation gates","Never hand-edit schema JSON to decimal(0,0)"],"tags":["maxcompute","decimal","type-conversion","schema"],"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"}