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

WARN logged by StarRocksTypeConverter.reconvert when a DECIMAL column's scale exceeds the supported maximum; scale/precision are adjusted to fit and the converted decimal(precision,scale) is emitted. Type-adjustment warning only.

Solutions

  1. Fix the source schema so scale <= precision
  2. Insert a transform cast to a valid decimal(p,s) with s <= p
  3. Accept the clamped type but verify fractional digits are not lost: with scale clamped to precision, integer digits become 0
Defensive patterns

Strategy: validation

Validate before calling

if (dt instanceof DecimalType) {
  DecimalType d = (DecimalType) dt;
  if (d.getScale() > d.getPrecision()) throw new IllegalArgumentException(
    "Column " + col.getName() + " decimal scale " + d.getScale() + " exceeds precision " + d.getPrecision());
}

Type guard

boolean hasValidDecimalScale(Column c) {
  if (!(c.getDataType() instanceof DecimalType)) return true;
  DecimalType d = (DecimalType) c.getDataType();
  return d.getScale() >= 0 && d.getScale() <= d.getPrecision();
}

Prevention

When it happens

Trigger: reconvert() (via keyColumnType/valueColumnType) encounters a DecimalType where scale > precision (e.g. decimal(5,10)).

Common situations: Misconfigured schema definitions; upstream engines or metadata that permit scale > precision; schema drift where precision shrank but scale did not.

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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/datatypes/StarRocksTypeConverter.java:277

                    builder.dataType(SR_VARCHAR);
                    builder.columnType(String.format("%s(%s)", SR_VARCHAR, 200));
                    break;
                }

                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)", SR_DECIMAL, precision, scale));
                builder.dataType(SR_DECIMAL);
                builder.precision((long) precision);
                builder.scale(scale);
                break;
            case TIME:
                builder.length(8L);
                builder.columnType(String.format("%s(%s)", SR_VARCHAR, 8));

View on GitHub (pinned to cf67b549a7)