{"record":{"id":"a1fc50c7d159ddaf","repo":"apache/seatunnel","slug":"the-decimal-column-type-decimal-is-out-o-a1fc50","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/phoenix/PhoenixTypeConverter.java","lineNumber":224,"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":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/phoenix/PhoenixTypeConverter.java#L206-L242","documentation":"During reconvert, if a decimal column's precision exceeds the maximum precision Phoenix supports (MAX_PRECISION), the converter cannot map it faithfully. It logs this warning and clamps the precision to MAX_PRECISION, reducing the scale by the same amount (bounded at 0), which may cause silent precision loss when writing to Phoenix.","triggerScenarios":"Calling PhoenixTypeConverter.reconvert() on a CatalogColumn with DecimalType precision > MAX_PRECISION (e.g. DECIMAL(65,30)); happens in the sink schema-mapping path of the Phoenix connector.","commonSituations":"Sources that declare very wide decimals (e.g. MySQL DECIMAL(65,x), Hive/Spark DECIMAL(38+)) being written to Phoenix; schema evolution increasing precision beyond Phoenix's limit.","solutions":["Reduce the decimal precision in the source/catalog to fit within Phoenix's MAX_PRECISION before sinking.","Cast or round the column earlier in the pipeline (e.g. with a transform) to a smaller precision.","Check the warning to confirm the clamped decimal(precision, scale) preserves enough fractional digits for your data.","If wider precision is required, use a different sink that supports larger decimals."],"exampleFix":"// before\nnew DecimalType(65, 30); // exceeds Phoenix max precision\n// after\nnew DecimalType(38, 10); // fits within MAX_PRECISION","handlingStrategy":"validation","validationCode":"DecimalType dt = (DecimalType) col.getDataType();\nif (dt.getPrecision() > phoenixMaxPrecision) {\n    col = CatalogColumn.of(col.getName(), new DecimalType(phoenixMaxPrecision, Math.max(0, dt.getScale() - (dt.getPrecision() - phoenixMaxPrecision))), col.isNullable(), col.getDefaultValue());\n}","typeGuard":"boolean fitsPhoenixPrecision(CatalogColumn c) {\n    return c.getDataType() instanceof DecimalType\n        && ((DecimalType) c.getDataType()).getPrecision() <= 38; // Phoenix max\n}","tryCatchPattern":null,"preventionTips":["Clamp precision upstream before sinking to Phoenix","ROUND/CAST wide decimals in a transform step","Test schema mapping with representative source schemas","Use a store that supports wide decimals if needed"],"tags":["jdbc","phoenix","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-14T05:17:10.506Z"}