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 precision of {}, it will be converted to decimal({},{})

What it means

A log warning in DmdbTypeConverter.reconvert: the decimal precision exceeds Dameng's MAX_PRECISION. The converter clamps precision to MAX_PRECISION and reduces scale by the overflow amount (flooring at 0), possibly losing scale digits.

Source

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

                DecimalType decimalType = (DecimalType) column.getDataType();
                long precision = decimalType.getPrecision();
                int scale = decimalType.getScale();
                if (precision <= 0) {
                    precision = DEFAULT_PRECISION;
                    scale = DEFAULT_SCALE;
                    log.warn(
                            "The decimal column {} type decimal({},{}) is out of range, "
                                    + "which is precision less than 0, "
                                    + "it will be converted to decimal({},{})",
                            column.getName(),
                            decimalType.getPrecision(),
                            decimalType.getScale(),
                            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(),

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Reduce the upstream column precision to fit Dameng's MAX_PRECISION (e.g. DECIMAL(38,x))
  2. Pre-create the DM column with an acceptable type and disable automatic type conversion for it
  3. Verify the clamped scale is acceptable; if data loss is unacceptable, change the upstream type
  4. Increase awareness by checking the converter constants (MAX_PRECISION) before designing the schema

Example fix

// before (MySQL)
DECIMAL(65,30)
// after (Dameng-compatible)
DECIMAL(38,10)
Defensive patterns

Strategy: validation

Validate before calling

if (decimalType.getPrecision() > MAX_PRECISION) {
    // redesign column type before running the job
}

Prevention

When it happens

Trigger: reconvert() on a DecimalType whose precision is greater than MAX_PRECISION (e.g. DECIMAL(65,30) coming from MySQL or another DB that supports larger decimals than Dameng).

Common situations: Cross-database sync from systems allowing precision > Dameng's maximum (e.g. MySQL DECIMAL(65,x)) into Dameng; wide financial columns losing scale after conversion.

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