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

A log warning in DmdbTypeConverter.reconvert: the decimal scale exceeds Dameng's MAX_SCALE. The converter clamps scale to MAX_SCALE, which truncates fractional digits capacity for the column definition.

Source

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

                            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,
                            precision,
                            scale);
                }
                builder.columnType(String.format("%s(%s,%s)", DM_DECIMAL, precision, scale));
                builder.dataType(DM_DECIMAL);
                builder.precision(precision);
                builder.scale(scale);
                break;
            case STRING:
                builder.length(column.getColumnLength());
                if (column.getColumnLength() == null || column.getColumnLength() <= 0) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Adjust the upstream decimal to fit Dameng scale limits (reduce scale, raise precision if needed)
  2. Pre-create the DM column with the desired type and exclude it from automatic type conversion
  3. Use a transform to round values to the supported scale before writing
  4. Review MAX_SCALE in DmdbTypeConverter and plan schema accordingly

Example fix

// before
DECIMAL(20, 18)
// after
DECIMAL(20, 6) -- assuming MAX_SCALE = 6
Defensive patterns

Strategy: validation

Validate before calling

if (decimalType.getScale() > MAX_SCALE) {
    // round values or adjust schema before sync
}

Prevention

When it happens

Trigger: reconvert() on a DecimalType whose scale is greater than MAX_SCALE while precision is within range (e.g. DECIMAL(30,40) or DECIMAL(10,25) from a source allowing large scales).

Common situations: High-precision scientific/financial data from sources like MySQL DECIMAL(20,20) exceeding Dameng scale limits; silent rounding capacity loss in target schema.

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