{"record":{"id":"53ae8660afea4422","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-53ae86","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/snowflake/SnowflakeTypeConverter.java","lineNumber":231,"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":213,"sourceCodeEnd":249,"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#L213-L249","documentation":"When converting a DECIMAL column for Snowflake, the declared precision exceeds Snowflake's maximum (38). SeaTunnel clamps precision to 38 and reduces the scale by the same amount (never below 0), logging this warning. Data with more significant digits may lose fractional precision after the conversion.","triggerScenarios":"reconvert() receives a DecimalType with precision > 38 (Snowflake's MAX_PRECISION), e.g. MySQL decimal(65,30) or similar wide-decimal sources being mapped to Snowflake DDL.","commonSituations":"MySQL/PostgreSQL sources with decimal(p>38) columns synced into Snowflake; catalog metadata declaring very large precisions from upstream engines that allow bigger precisions than Snowflake.","solutions":["Reduce the source column precision to <= 38 (ALTER TABLE on the source) so no precision is truncated.","Pre-create the Snowflake target table and cast/round the value in the pipeline before writing.","Review the warning to confirm the clamped decimal(p,s) preserves the digits you need; adjust source scale accordingly.","If exact precision matters, switch the column to STRING in the pipeline to avoid numeric truncation."],"exampleFix":"// before\nnew DecimalType(65, 30)\n// after: fits Snowflake max precision 38\nnew DecimalType(38, 10)","handlingStrategy":"validation","validationCode":"DecimalType dt = (DecimalType) column.getDataType();\nif (dt.getPrecision() > 38) {\n    log.warn(\"Column {} precision {} exceeds Snowflake max 38; will be clamped\",\n        column.getName(), dt.getPrecision());\n}","typeGuard":"boolean fitsSnowflakePrecision(Column c) {\n    return !(c.getDataType() instanceof DecimalType)\n        || ((DecimalType) c.getDataType()).getPrecision() <= 38;\n}","tryCatchPattern":null,"preventionTips":["Keep decimal precision <= 38 when targeting Snowflake","Review wide-decimal columns (e.g. MySQL decimal(65,x)) before sync","Pre-create Snowflake DDL and cast in-pipeline when precision must exceed 38"],"tags":["jdbc","snowflake","decimal-precision","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"}