{"record":{"id":"64d43bc5cb78ab99","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-64d43b","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/sqlserver/SqlServerTypeConverter.java","lineNumber":354,"sourceCode":"                builder.columnType(SQLSERVER_BIGINT);\n                builder.dataType(SQLSERVER_BIGINT);\n                break;\n            case FLOAT:\n                builder.columnType(SQLSERVER_REAL);\n                builder.dataType(SQLSERVER_REAL);\n                break;\n            case DOUBLE:\n                builder.columnType(SQLSERVER_FLOAT);\n                builder.dataType(SQLSERVER_FLOAT);\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":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/sqlserver/SqlServerTypeConverter.java#L336-L372","documentation":"SqlServerTypeConverter.reconvert found a DECIMAL column whose precision is <= 0, which SQL Server cannot represent. It clamps to the default precision/scale and logs a warning; data conversion continues with the adjusted type.","triggerScenarios":"A pipeline column of DecimalType with precision 0 or negative (usually from an upstream parser producing decimal(0,s) or unset precision) is converted into a SQL Server type via reconvert.","commonSituations":"Source connectors emitting DecimalType with precision unset/0; SeaTunnel config or schema inference bugs producing decimal(0); deserialized schemas losing precision metadata.","solutions":["Fix the upstream schema so the DECIMAL column carries a positive precision.","Explicitly declare the column type in your source config, e.g. decimal(38,10).","If the source default is fine, accept the warning — the column becomes DEFAULT_PRECISION/DEFAULT_SCALE."],"exampleFix":"// before\nschema = { field = \"amount\", type = \"decimal(0,2)\" }\n// after\nschema = { field = \"amount\", type = \"decimal(18,2)\" }","handlingStrategy":"validation","validationCode":"// Validate decimal precision before writing:\nif (dt.getPrecision() <= 0) throw new IllegalArgumentException(\"decimal precision must be > 0 for column \" + col.getName());","typeGuard":"boolean isValidDecimal(DecimalType dt) { return dt.getPrecision() > 0 && dt.getScale() >= 0 && dt.getScale() <= dt.getPrecision(); }","tryCatchPattern":null,"preventionTips":["Always declare explicit decimal precision/scale in source schemas","Check upstream connectors for type-inference bugs producing precision 0","Validate schemas programmatically before job submission"],"tags":["jdbc","sqlserver","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"}