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

What it means

A log warning in DmdbTypeConverter.reconvert: a DecimalType column with a negative scale cannot be represented in Dameng. The converter resets scale to 0 and logs the conversion. Precision-based clamping (3452/3453) runs first; this check catches any remaining negative scale.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dm/DmdbTypeConverter.java:395

                            precision,
                            scale);
                } else if (precision > MAX_PRECISION) {
                    scale = (int) Math.max(0, scale - (precision - MAX_PRECISION));
                    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 decimal({},{})",
                            column.getName(),
                            decimalType.getPrecision(),
                            decimalType.getScale(),
                            MAX_PRECISION,
                            precision,
                            scale);
                }
                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 > MAX_SCALE) {
                    scale = MAX_SCALE;
                    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(),
                            MAX_SCALE,

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Change the upstream schema to use scale >= 0
  2. Round/wrap the value in a transform before the sink so scale is non-negative
  3. Accept scale=0 conversion (values are effectively integers) if lossless scaling is not needed
  4. Normalize column metadata at the source connector level before it reaches the sink

Example fix

// before
DECIMAL(10, -2)
// after
DECIMAL(10, 0)
Defensive patterns

Strategy: validation

Validate before calling

if (decimalType.getScale() < 0) {
    throw new IllegalArgumentException("decimal scale must be >= 0");
}

Prevention

When it happens

Trigger: reconvert() on a DecimalType with scale < 0 (some systems allow negative scale, e.g. Oracle NUMBER(p,-s) semantics, or misconfigured DecimalType construction).

Common situations: Syncing from Oracle-style NUMBER columns with negative scale into Dameng; programmatically built DecimalType with invalid scale.

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