{"record":{"id":"5d466d73cc02332e","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-5d466d","errorCode":null,"errorMessage":"The decimal column {} type decimal({},{}) is out of range, which exceeds the maximum scale of {}, it will be converted to decimal({},{})","messagePattern":"The decimal column (.+?) type decimal\\((.+?),(.+?)\\) is out of range, which exceeds the maximum scale 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":395,"sourceCode":"                            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(),\n                            decimalType.getScale(),\n                            precision,\n                            scale);\n                } else if (scale > MAX_SCALE) {\n                    scale = MAX_SCALE;\n                    log.warn(\n                            \"The decimal column {} type decimal({},{}) is out of range, \"\n                                    + \"which exceeds the maximum scale of {}, \"\n                                    + \"it will be converted to decimal({},{})\",\n                            column.getName(),\n                            decimalType.getPrecision(),\n                            decimalType.getScale(),\n                            MAX_SCALE,\n                            precision,\n                            scale);\n                }\n                builder.columnType(String.format(\"%s(%s,%s)\", HANA_DECIMAL, precision, scale));\n                builder.dataType(HANA_DECIMAL);\n                builder.precision(precision);\n                builder.scale(scale);\n                break;\n            case BYTES:\n                builder.columnType(HANA_BLOB);\n                builder.dataType(HANA_BLOB);","sourceCodeStart":377,"sourceCodeEnd":413,"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#L377-L413","documentation":"WARN log from SapHanaTypeConverter.reconvert. When a DECIMAL column's scale exceeds SAP HANA's MAX_SCALE, the converter clamps scale to the max and logs this warning; the generated decimal(p,s) DDL uses the clamped scale, so fractional precision beyond the cap is lost.","triggerScenarios":"Auto table creation for a SAP HANA sink where DecimalType.getScale() > MAX_SCALE; raised in reconvert().","commonSituations":"Sources with extremely high fractional precision (e.g. DECIMAL(38,40) from unusual metadata or engines permitting scale > precision) targeting SAP HANA.","solutions":["Cast the column to a supported decimal scale (e.g. DECIMAL(38,18)) before the sink","Pre-create the SAP HANA table with a valid DECIMAL(p,s)","Accept the clamped scale after validating rounding behavior"],"exampleFix":"// before: DECIMAL(30,40)\n// after: transform cast\n// sql = \"SELECT CAST(v AS DECIMAL(38,18)) AS v FROM src\"","handlingStrategy":"validation","validationCode":"if (decimalType.getScale() > maxScale) {\n    // CAST(v AS DECIMAL(p, maxScale)) before the sink\n}","typeGuard":"boolean scaleFits(DecimalType t, int max) { return t.getScale() <= max; }","tryCatchPattern":null,"preventionTips":["Limit fractional scale to what SAP HANA supports","Cast high-scale decimals upstream","Verify rounding behavior of clamped columns with test data"],"tags":["jdbc","saphana","type-conversion","decimal-scale"],"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"}