{"record":{"id":"20669a7d8574ba9c","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-20669a","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/snowflake/SnowflakeTypeConverter.java","lineNumber":255,"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)\", SNOWFLAKE_DECIMAL, precision, scale));\n                builder.dataType(SNOWFLAKE_DECIMAL);\n                builder.precision(precision);\n                builder.scale(scale);\n                break;\n            case FLOAT:\n                builder.columnType(SNOWFLAKE_FLOAT4);\n                builder.dataType(SNOWFLAKE_FLOAT4);","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/snowflake/SnowflakeTypeConverter.java#L237-L273","documentation":"During DECIMAL conversion for Snowflake, the column's scale exceeds Snowflake's maximum (38). SeaTunnel clamps the scale to 38 and logs this warning. If scale clamping would leave less than one integer digit of precision, values may overflow or lose integer digits.","triggerScenarios":"reconvert() receives a DecimalType whose scale > 38 (Snowflake MAX_SCALE), e.g. decimal(10,40) or sources declaring scale larger than precision.","commonSituations":"Misconfigured source schemas (scale > precision), engines allowing very high scale (e.g. Postgres numeric with huge scale) synced to Snowflake.","solutions":["Correct the source decimal definition so scale <= 38 and scale <= precision.","Pre-create the Snowflake target table with a valid DECIMAL(p,s) and cast values in the pipeline.","Reduce the source column scale explicitly before syncing.","Ignore the warning if clamping to decimal(p,38) is acceptable."],"exampleFix":"// before\nnew DecimalType(10, 40)\n// after\nnew DecimalType(38, 38)","handlingStrategy":"validation","validationCode":"DecimalType dt = (DecimalType) column.getDataType();\nif (dt.getScale() > 38) {\n    log.warn(\"Column {} scale {} exceeds Snowflake max 38; will be clamped\",\n        column.getName(), dt.getScale());\n}","typeGuard":"boolean fitsSnowflakeScale(Column c) {\n    return !(c.getDataType() instanceof DecimalType)\n        || ((DecimalType) c.getDataType()).getScale() <= 38;\n}","tryCatchPattern":null,"preventionTips":["Ensure scale <= 38 and scale <= precision for Snowflake targets","Fix schema files declaring scale larger than precision","Pre-create target tables with valid DECIMAL(p,s) definitions"],"tags":["jdbc","snowflake","decimal-scale","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"}