{"record":{"id":"0db13c74f31e0938","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-0db13c","errorCode":null,"errorMessage":"The decimal column {} type decimal({},{}) is out of range, which exceeds the maximum precision of {}, it will be converted to decimal({},{})","messagePattern":"The decimal column (.+?) type decimal\\((.+?),(.+?)\\) is out of range, which exceeds the maximum precision of (.+?), 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":366,"sourceCode":"                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(),\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(),","sourceCodeStart":348,"sourceCodeEnd":384,"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#L348-L384","documentation":"A DECIMAL column's precision exceeds SQL Server's maximum (38). reconvert reduces precision to MAX_PRECISION, shrinking scale by the same excess (clamped at 0), and logs a warning that the effective type differs from the requested one.","triggerScenarios":"Converting a DecimalType with precision > 38 (e.g. decimal(50,20) from sources like BigQuery/Oracle NUMBER or user config) into a SQL Server type.","commonSituations":"Syncing from engines that allow larger precisions (Hive/BigQuery/Postgres with big NUMERIC) into SQL Server; hand-written SeaTunnel schemas with over-large precisions.","solutions":["Reduce the source column precision to <= 38 in your schema definition.","If values genuinely need more than 38 digits, pre-scale them (divide) or store as STRING in SQL Server.","Accept the warning if truncation of precision headroom is acceptable."],"exampleFix":"// before\nfield = { name = \"amount\", type = \"decimal(50,20)\" }\n// after\nfield = { name = \"amount\", type = \"decimal(38,8)\" } // 38-20=18 excess shaved from scale","handlingStrategy":"validation","validationCode":"if (dt.getPrecision() > 38) throw new IllegalArgumentException(\"SQL Server supports max precision 38; got \" + dt.getPrecision() + \" for \" + col.getName());","typeGuard":"boolean fitsSqlServerDecimal(DecimalType dt) { return dt.getPrecision() > 0 && dt.getPrecision() <= 38; }","tryCatchPattern":null,"preventionTips":["Cap decimal precision at 38 when targeting SQL Server","Pre-scale oversized numerics (divide) or store as STRING","Review source-engine precision limits when planning cross-DB migrations"],"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"}