{"record":{"id":"aa69fc080414fad9","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-aa69fc","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/saphana/SapHanaTypeConverter.java","lineNumber":371,"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":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/saphana/SapHanaTypeConverter.java#L353-L389","documentation":"WARN log from SapHanaTypeConverter.reconvert. When a DECIMAL column's precision exceeds SAP HANA's MAX_PRECISION, the converter reduces precision to the max and correspondingly shrinks the scale (scale = max(0, scale - (precision - MAX_PRECISION))), logging this warning. The generated DDL uses the clamped values, so high-precision data may lose scale or fail on write.","triggerScenarios":"Auto table creation for a SAP HANA sink where DecimalType.getPrecision() > MAX_PRECISION (HANA allows max 38); raised in reconvert().","commonSituations":"Copying DECIMAL(40+) or very wide decimals from engines/formats that allow larger precision (or malformed metadata claiming huge precision) into SAP HANA.","solutions":["Reduce the source decimal precision to <= MAX_PRECISION via a cast before the sink","Pre-create the SAP HANA table with a valid DECIMAL(p,s) that fits","Accept the clamped precision/scale after verifying no precision loss matters"],"exampleFix":"// before: DECIMAL(42,10)\n// after: transform cast\n// sql = \"SELECT CAST(v AS DECIMAL(38,10)) AS v FROM src\"","handlingStrategy":"validation","validationCode":"if (decimalType.getPrecision() > maxPrecision /* 38 for HANA */) {\n    // CAST(v AS DECIMAL(38, s')) where s' keeps needed scale\n}","typeGuard":"boolean precisionFits(DecimalType t, int max) { return t.getPrecision() <= max; }","tryCatchPattern":null,"preventionTips":["Cap decimal precision at 38 when targeting SAP HANA","Cast oversized decimals in a transform before the sink","Test with representative high-precision data before production runs"],"tags":["jdbc","saphana","type-conversion","decimal-precision"],"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"}