{"record":{"id":"2f1d82ab89a0d693","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-2f1d82","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/saphana/SapHanaTypeConverter.java","lineNumber":359,"sourceCode":"                builder.columnType(HANA_BIGINT);\n                builder.dataType(HANA_BIGINT);\n                break;\n            case FLOAT:\n                builder.columnType(HANA_REAL);\n                builder.dataType(HANA_REAL);\n                break;\n            case DOUBLE:\n                builder.columnType(HANA_DOUBLE);\n                builder.dataType(HANA_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":341,"sourceCodeEnd":377,"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#L341-L377","documentation":"WARN log from SapHanaTypeConverter.reconvert. When a DECIMAL column's precision is <= 0 (invalid for SAP HANA), the converter replaces it with DEFAULT_PRECISION/DEFAULT_SCALE and logs this warning instead of failing; the generated decimal(p,s) DDL uses the defaults.","triggerScenarios":"Sink-side type mapping where a DecimalType column reports precision <= 0; raised in reconvert() when building SAP HANA decimal column types.","commonSituations":"Sources or upstream transforms that produce decimal types with unset/zero precision (e.g. connectors with missing metadata, or decimal created without explicit precision).","solutions":["Set an explicit positive precision on the decimal column in the source or a transform","Pre-create the SAP HANA table with the intended DECIMAL(p,s) definition","Accept the default precision/scale substitution if it fits your data"],"exampleFix":"// before: decimal with precision 0 from source metadata\n// after: cast to explicit decimal in a transform\n// sql = \"SELECT CAST(amount AS DECIMAL(38,10)) AS amount FROM src\"","handlingStrategy":"validation","validationCode":"if (decimalType.getPrecision() <= 0) {\n    // assign explicit precision/scale, e.g. DECIMAL(38,18), before the sink\n}","typeGuard":"boolean hasValidPrecision(DecimalType t) { return t.getPrecision() > 0; }","tryCatchPattern":null,"preventionTips":["Always define decimals with explicit precision/scale at the source","Avoid transforms that create decimals without precision metadata","Pre-create SAP HANA tables with explicit DECIMAL(p,s)"],"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"}