apache/seatunnel · warning

The decimal column type decimal( , ) is out of range, which…

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

During DECIMAL conversion for Snowflake, the column's scale exceeds Snowflake's maximum (38). SeaTunnel clamps the scale to 38 and logs this warning. If scale clamping would leave less than one integer digit of precision, values may overflow or lose integer digits.

Solutions

  1. Correct the source decimal definition so scale <= 38 and scale <= precision.
  2. Pre-create the Snowflake target table with a valid DECIMAL(p,s) and cast values in the pipeline.
  3. Reduce the source column scale explicitly before syncing.
  4. Ignore the warning if clamping to decimal(p,38) is acceptable.

Example fix

// before
new DecimalType(10, 40)
// after
new DecimalType(38, 38)
Defensive patterns

Strategy: validation

Validate before calling

DecimalType dt = (DecimalType) column.getDataType();
if (dt.getScale() > 38) {
    log.warn("Column {} scale {} exceeds Snowflake max 38; will be clamped",
        column.getName(), dt.getScale());
}

Type guard

boolean fitsSnowflakeScale(Column c) {
    return !(c.getDataType() instanceof DecimalType)
        || ((DecimalType) c.getDataType()).getScale() <= 38;
}

Prevention

When it happens

Trigger: reconvert() receives a DecimalType whose scale > 38 (Snowflake MAX_SCALE), e.g. decimal(10,40) or sources declaring scale larger than precision.

Common situations: Misconfigured source schemas (scale > precision), engines allowing very high scale (e.g. Postgres numeric with huge scale) synced to Snowflake.

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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/snowflake/SnowflakeTypeConverter.java:255

                            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)", SNOWFLAKE_DECIMAL, precision, scale));
                builder.dataType(SNOWFLAKE_DECIMAL);
                builder.precision(precision);
                builder.scale(scale);
                break;
            case FLOAT:
                builder.columnType(SNOWFLAKE_FLOAT4);
                builder.dataType(SNOWFLAKE_FLOAT4);

View on GitHub (pinned to cf67b549a7)