{"record":{"id":"418ed093e6384333","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-418ed0","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-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/db2/DB2TypeConverter.java","lineNumber":270,"sourceCode":"                builder.columnType(DB2_BIGINT);\n                builder.dataType(DB2_BIGINT);\n                break;\n            case FLOAT:\n                builder.columnType(DB2_REAL);\n                builder.dataType(DB2_REAL);\n                break;\n            case DOUBLE:\n                builder.columnType(DB2_DOUBLE);\n                builder.dataType(DB2_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":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/db2/DB2TypeConverter.java#L252-L288","documentation":"DB2TypeConverter.reconvert converts a SeaTunnel DecimalType back to a DB2-compatible definition. DB2 requires a positive decimal precision; if the column's precision is <= 0, the converter logs this warning and replaces the type with DEFAULT_PRECISION/DEFAULT_SCALE (decimal(5,0)). The pipeline continues with the substituted type.","triggerScenarios":"reconvert encounters a column whose DecimalType has precision <= 0, e.g. decimal(0,0) produced by an upstream mapping bug, a manually authored schema, or a source connector emitting a degenerate decimal.","commonSituations":"Hand-written SeaTunnel schema files with decimal(0); source connectors that report precision 0 when metadata is unavailable; programmatic schema construction passing 0/-1 precision.","solutions":["Fix the upstream schema so the decimal column carries a real precision (e.g. DECIMAL(10,2))","Check the source connector's type mapping if it reports precision 0 from database metadata","If authoring schemas manually, use precision >= 1 and scale <= precision","Upgrade/patch the source connector if its metadata parsing is known to emit 0 precision"],"exampleFix":"// before (schema)\nDecimalType(0, 0)\n// after\nDecimalType(10, 2)","handlingStrategy":"validation","validationCode":"// before write\nDecimalType dt = (DecimalType) column.getDataType();\nif (dt.getPrecision() <= 0) {\n    throw new IllegalArgumentException(\"Column \" + column.getName() + \" has invalid decimal precision \" + dt.getPrecision());\n}","typeGuard":"boolean isValidDecimal(ColumnType col) {\n    return col.getDataType() instanceof DecimalType\n        && ((DecimalType) col.getDataType()).getPrecision() > 0;\n}","tryCatchPattern":null,"preventionTips":["Never hand-author decimal types with precision 0 or negative","Verify source connector metadata actually reports precision for decimal columns","Add schema validation before job submission","Treat this warning as a schema bug upstream, not a cosmetic issue"],"tags":["jdbc","db2","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-14T05:17:10.506Z"}