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

What it means

A log warning in DmdbTypeConverter.reconvert: a DecimalType column whose precision is <= 0 cannot be represented in Dameng DECIMAL. The converter substitutes DEFAULT_PRECISION/DEFAULT_SCALE and logs the original and converted values. The schema is silently corrected rather than failing.

Source

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

                builder.columnType(DM_BIGINT);
                builder.dataType(DM_BIGINT);
                break;
            case FLOAT:
                builder.columnType(DM_REAL);
                builder.dataType(DM_REAL);
                break;
            case DOUBLE:
                builder.columnType(DM_DOUBLE);
                builder.dataType(DM_DOUBLE);
                break;
            case DECIMAL:
                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(),

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Fix the upstream SeaTunnel schema so the decimal precision is a positive value within Dameng limits
  2. Explicitly define the column type (e.g. DECIMAL(38,10)) in the source/catalog config instead of relying on inferred precision
  3. Accept the converted DEFAULT_PRECISION value if acceptable downstream
  4. Validate column definitions with a catalog/dialect validation step before running the job

Example fix

// before
SeaTunnelRowType with DECIMAL(0, 5)
// after
SeaTunnelRowType with DECIMAL(38, 5)
Defensive patterns

Strategy: validation

Validate before calling

if (decimalType.getPrecision() <= 0) {
    throw new IllegalArgumentException(
        "column " + name + " decimal precision must be > 0");
}

Prevention

When it happens

Trigger: reconvert() called on a LogicalType DecimalType with precision <= 0 (e.g. decimal(0,s) or a decimal constructed from metadata lacking precision), typically during sink-to-catalog type re-conversion in applySchemaChange or DDL generation.

Common situations: Upstream sources/reporting decimal(0,...) or uninitialized precision; custom source connectors producing degenerate DecimalType; schema-translation paths that bypass validation.

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