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 is scale less than 0, it will be converted to decimal({},{})

What it means

RowTypeConverter decimal visit: a negative scale is invalid for Paimon decimal columns, so the converter resets scale to DecimalType.DEFAULT_SCALE (precision already fixed) and warns that the type was rewritten.

Solutions

  1. Remove negative scale from the declared type; model rounding in a transform if needed.
  2. Cast the column to a positive-scale decimal (or string) before the Paimon sink.
  3. Confirm DEFAULT_SCALE output still represents your values; otherwise widen precision explicitly.
  4. Fix the source connector type mapping that produced the negative scale.

Example fix

// before
DECIMAL(10,-2)
// after
DECIMAL(10,0)  // or apply ROUND in a transform first
Defensive patterns

Strategy: validation

Validate before calling

if (decimalType.getScale() < 0) decimalType = new DecimalType(decimalType.getPrecision(), 0);

Type guard

boolean hasNonNegativeScale(DecimalType t) { return t.getScale() >= 0; }

Prevention

When it happens

Trigger: Column declared decimal(p,-n) (negative scale, allowed in some engines for rounding to tens/hundreds) when converting to Paimon row type.

Common situations: Oracle NUMBER(p,-n) style columns; upstream frameworks emitting negative scale after their own clamping; manually written schema decimal(10,-2).

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/781db945ae1b8adc. 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:352

                                precision,
                                scale);
                    } else if (precision > DecimalType.MAX_PRECISION) {
                        scale = (int) Math.max(0, scale - (precision - DecimalType.MAX_PRECISION));
                        precision = DecimalType.MAX_PRECISION;
                        log.warn(
                                "The decimal column {} type decimal({},{}) is out of range, "
                                        + "which exceeds the maximum precision of {}, "
                                        + "it will be converted to decimal({},{})",
                                column.getName(),
                                seatunnelDecimalType.getPrecision(),
                                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,

View on GitHub (pinned to cf67b549a7)