{"record":{"id":"23e88a4fc43a132e","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-23e88a","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/yashandb/YashanDbTypeConverter.java","lineNumber":358,"sourceCode":"                builder.columnType(BIGINT);\n                builder.dataType(BIGINT);\n                break;\n            case FLOAT:\n                builder.columnType(FLOAT);\n                builder.dataType(FLOAT);\n                break;\n            case DOUBLE:\n                builder.columnType(DOUBLE);\n                builder.dataType(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":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbTypeConverter.java#L340-L376","documentation":"Warning from YashanDbTypeConverter.reconvert when a DECIMAL column has precision <= 0, which YashanDB cannot represent. The converter substitutes DEFAULT_PRECISION/DEFAULT_SCALE and logs; no exception is raised.","triggerScenarios":"Sink write to YashanDB where the incoming column is DecimalType with precision 0 or negative (typically from a broken or degenerate schema inference upstream).","commonSituations":"Schema inferred from bad metadata (some drivers return precision 0); hand-written catalog definitions with decimal(0,s); auto table creation from a corrupted source schema.","solutions":["Fix the source schema so the decimal has a valid precision (>= 1).","Explicitly define the target YashanDB column as DECIMAL(p,s) with correct precision.","Verify upstream connector metadata (JDBC driver precision reporting) is correct."],"exampleFix":"// before: decimal(0,0)\n// after\nSQL: CAST(amount AS DECIMAL(38,10)) AS amount","handlingStrategy":"validation","validationCode":"DecimalType d = (DecimalType) col.getDataType();\nif (d.getPrecision() <= 0) {\n    col = col.copy().setDataType(new DecimalType(DEFAULT_PRECISION, DEFAULT_SCALE)).build();\n}","typeGuard":"boolean validPrecision(DecimalType d) { return d.getPrecision() > 0; }","tryCatchPattern":null,"preventionTips":["Validate source schemas for degenerate decimal(0,s) before writes","Fix JDBC driver metadata issues rather than relying on clamps","Declare target decimals explicitly in catalog DDL"],"tags":["jdbc","yashandb","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"}