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

What it means

During Snowflake DECIMAL column conversion (SnowflakeTypeConverter.reconvert), the column's declared precision was <= 0, which Snowflake cannot represent. SeaTunnel silently substitutes the default precision/scale (38,10 by default) and logs this warning instead of failing. The job continues, but the resulting DDL may not match the source column.

Solutions

  1. Fix the upstream schema so the decimal column carries a valid precision (> 0).
  2. If the source cannot provide precision, pre-create the Snowflake table with the intended DECIMAL(p,s) so schema conversion is not needed.
  3. Explicitly set precision when constructing the column in your config/pipeline instead of relying on defaults.
  4. Ignore the warning if falling back to decimal(38,10) is acceptable for your data.

Example fix

// before: Column with DecimalType(precision=0)
new DecimalType(0, 10)
// after
new DecimalType(38, 10)
Defensive patterns

Strategy: validation

Validate before calling

if (column.getDataType() instanceof DecimalType) {
    DecimalType dt = (DecimalType) column.getDataType();
    if (dt.getPrecision() <= 0) {
        // fix or log before submitting to Snowflake converter
        log.warn("Column {} has invalid precision {}", column.getName(), dt.getPrecision());
    }
}

Type guard

boolean hasValidPrecision(Column c) {
    return c.getDataType() instanceof DecimalType
        && ((DecimalType) c.getDataType()).getPrecision() > 0;
}

Prevention

When it happens

Trigger: A catalog table schema carries a DecimalType column whose precision is 0 or negative; this typically happens when the source metadata reports an unspecified/invalid decimal precision and reconvert() is invoked to build Snowflake DDL or type mapping.

Common situations: Syncing tables from sources that report DECIMAL without precision (e.g. some CDC payloads or generic JDBC drivers reporting precision 0); programmatically built Column definitions with unset precision.

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/7c0523ddb7c008f7. 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:219

                builder.columnType(SNOWFLAKE_SMALLINT);
                builder.dataType(SNOWFLAKE_SMALLINT);
                break;
            case INT:
                builder.columnType(SNOWFLAKE_INTEGER);
                builder.dataType(SNOWFLAKE_INTEGER);
                break;
            case BIGINT:
                builder.columnType(SNOWFLAKE_BIGINT);
                builder.dataType(SNOWFLAKE_BIGINT);
                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)