apache/seatunnel · warning

The decimal column {} type decimal({},{}) is out of range, w

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

sampleReconvert finds a decimal column where scale > precision, which is invalid for Doris DECIMAL (scale must not exceed precision). The converter warns, clamps scale to precision, and converts the column to decimal(precision, precision).

Source

Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/datatype/AbstractDorisTypeConverter.java:365

                            precision,
                            getMaxDecimalScale());
                    scale = getMaxDecimalScale();
                }

                if (scale < 0) {
                    scale = 0;
                    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(),
                            decimalType.getPrecision(),
                            decimalType.getScale(),
                            precision,
                            scale);
                } else if (scale > precision) {
                    scale = 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(),
                            decimalType.getPrecision(),
                            decimalType.getScale(),
                            precision,
                            precision,
                            scale);
                }

                builder.columnType(String.format("%s(%s,%s)", DORIS_DECIMALV3, precision, scale));
                builder.dataType(DORIS_DECIMALV3);
                builder.precision((long) precision);
                builder.scale(scale);
                break;
            case TIME:
                builder.length(8L);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Fix the DDL so scale <= precision, e.g. DECIMAL(10,5) instead of DECIMAL(5,10)
  2. If all-fractional values are needed, widen precision to at least the desired scale
  3. Accept the clamped decimal(p,p) fallback and validate that values still fit (integer digits are dropped)

Example fix

// before
DECIMAL(5,10)
// after
DECIMAL(10,10);
Defensive patterns

Strategy: validation

Validate before calling

if (decimalType.getScale() > decimalType.getPrecision()) {
    // invalid: widen precision so scale <= precision
}

Prevention

When it happens

Trigger: sampleReconvert processes a DecimalType with getScale() > getPrecision() while building the SeaTunnel schema from Doris table metadata.

Common situations: Schemas imported from systems that permit scale > precision (some allow it, meaning all digits are fractional); manual DDL mistakes like DECIMAL(5,10).

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/f56352c0a8ca37a0. Report an issue: GitHub.