apache/seatunnel · warning

The decimal column type decimal( , ) is out of range, which…

Error message

The decimal column {} type decimal({},{}) is out of range, which exceeds the maximum scale of {}, it will be converted to decimal({},{})

What it means

RowTypeConverter decimal visit: when scale exceeds Paimon's allowed maximum (checked as > DecimalType.MAX_PRECISION here), the converter clamps scale to that maximum and warns that the decimal type was rewritten, possibly losing sub-scale digits.

Solutions

  1. Declare an explicit decimal(p,s) with p,s within 1..38 in your job schema.
  2. Round/truncate in a transform before the sink so lost digits are intentional.
  3. Fix the source metadata mapping that emitted the oversized scale.
  4. Accept the clamp only after verifying values never need digits beyond scale 38.

Example fix

// before
DECIMAL(38,50)
// after
DECIMAL(38,18)  // scale clamped to a legal value
Defensive patterns

Strategy: validation

Validate before calling

if (decimalType.getScale() > 38) decimalType = new DecimalType(decimalType.getPrecision(), 38);

Type guard

boolean legalScale(DecimalType t) { return t.getScale() <= 38 && t.getScale() >= 0; }

Prevention

When it happens

Trigger: Column declared decimal(p,s) with s > 38 while RowTypeConverter converts the schema for Paimon.

Common situations: Precision-less sources that set scale extremely high (e.g. scale = Integer.MAX_VALUE placeholders); source engines allowing scale > precision; misconfigured schema templates.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/b0b3e1003998684a. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/utils/RowTypeConverter.java:363

                                seatunnelDecimalType.getScale(),
                                DecimalType.MAX_PRECISION,
                                precision,
                                scale);
                    }
                    if (scale < 0) {
                        scale = DecimalType.DEFAULT_SCALE;
                        log.warn(
                                "The decimal column {} type decimal({},{}) is out of range, "
                                        + "which is scale less than 0, "
                                        + "it will be converted to decimal({},{})",
                                column.getName(),
                                seatunnelDecimalType.getPrecision(),
                                seatunnelDecimalType.getScale(),
                                precision,
                                scale);
                    } else if (scale > DecimalType.MAX_PRECISION) {
                        scale = DecimalType.MAX_PRECISION;
                        log.warn(
                                "The decimal column {} type decimal({},{}) is out of range, "
                                        + "which exceeds the maximum scale of {}, "
                                        + "it will be converted to decimal({},{})",
                                column.getName(),
                                seatunnelDecimalType.getPrecision(),
                                seatunnelDecimalType.getScale(),
                                DecimalType.MAX_PRECISION,
                                precision,
                                scale);
                    }

                    DecimalType paimonDecimalType = DataTypes.DECIMAL(precision, scale);
                    builder.nativeType(paimonDecimalType.copy(column.isNullable()));
                    builder.columnType(paimonDecimalType.toString());
                    builder.dataType(paimonDecimalType.getTypeRoot().name());
                    builder.scale(scale);
                    builder.precision((long) precision);
                    builder.length(column.getColumnLength());

View on GitHub (pinned to cf67b549a7)