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

WARN logged by StarRocksTypeConverter.reconvert when a DECIMAL column's precision exceeds the connector maximum; depending on branch the type is adjusted or degraded (e.g. varchar(200)) and the resulting type is emitted. Type-adjustment warning only.

Solutions

  1. Redefine the source column with a non-negative scale
  2. Cast the column in a transform to a plain decimal(p,0) before sinking
  3. If rounding at powers of ten matters, do explicit rounding in a transform, since scale is clamped to 0
Defensive patterns

Strategy: validation

Validate before calling

if (dt instanceof DecimalType) {
  DecimalType d = (DecimalType) dt;
  if (d.getScale() < 0) throw new IllegalArgumentException(
    "Column " + col.getName() + " has negative decimal scale " + d.getScale());
}

Type guard

boolean hasNonNegativeScale(Column c) {
  return !(c.getDataType() instanceof DecimalType)
      || ((DecimalType) c.getDataType()).getScale() >= 0;
}

Prevention

When it happens

Trigger: reconvert() (via keyColumnType/valueColumnType) receives a DecimalType whose scale is < 0 (allowed by some engines to mean rounding to powers of ten).

Common situations: Sources like newer SQL Server / Postgres semantics allowing negative scale (numeric(p,-3)); hand-built schemas with placeholder scale -1.

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/461770390684ad79. 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:266

                            precision,
                            scale);
                } else if (precision > MAX_PRECISION) {
                    log.warn(
                            "The decimal column {} type decimal({},{}) is out of range, "
                                    + "which exceeds the maximum precision of {}, "
                                    + "it will be converted to varchar(200)",
                            column.getName(),
                            decimalType.getPrecision(),
                            decimalType.getScale(),
                            MAX_PRECISION);
                    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,

View on GitHub (pinned to cf67b549a7)