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

sampleReconvert detects a decimal column whose scale is negative (after prior clamping). Negative scale is invalid, so the converter warns, sets scale to 0, and converts the column to decimal(precision, 0), turning it into an integer-valued decimal.

Source

Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/datatype/AbstractDorisTypeConverter.java:354

                }

                if (scale > getMaxDecimalScale()) {
                    log.warn(
                            "The decimal column {} type decimal({},{}) is out of range, "
                                    + "which exceeds the maximum scale of {} supported by this "
                                    + "Doris version, it will be converted to decimal({},{})",
                            column.getName(),
                            decimalType.getPrecision(),
                            decimalType.getScale(),
                            getMaxDecimalScale(),
                            precision,
                            getMaxDecimalScale());
                    scale = getMaxDecimalScale();
                }

                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)

Solutions

  1. Redeclare the column with a non-negative scale in Doris
  2. If the negative scale was intentional (e.g. Oracle-style thousands rounding), pre-round values in a transform since the fallback makes scale 0
  3. Accept the decimal(p,0) fallback if integer-valued decimals suffice

Example fix

// before: DecimalType precision=10, scale=-2
// after: converter uses decimal(10,0); upstream declare
DECIMAL(10,0) -- or pre-round values in a transform
Defensive patterns

Strategy: validation

Validate before calling

if (decimalType.getScale() < 0) {
    // redeclare as DECIMAL(p,0) or pre-round values upstream
}

Prevention

When it happens

Trigger: sampleReconvert encounters DecimalType with getScale() < 0 (or a scale that became negative after precision-based adjustments) while mapping the Doris schema back to SeaTunnel types.

Common situations: Schema metadata from other systems allowing negative scale (e.g. Oracle NUMBER(p,-s)); hand-written or generated type definitions with negative 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/c087cbfe0f26b294. Report an issue: GitHub.