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

A DECIMAL column's scale exceeds SQL Server's maximum allowed scale (MAX_SCALE). reconvert clamps scale to MAX_SCALE (precision permitting) and logs a warning that the effective type is coarser than requested.

Solutions

  1. Reduce the scale in your schema to the SQL Server limit (e.g. decimal(38,10)).
  2. Pre-round/scale values in a transform if sub-limit precision matters.
  3. Accept the warning if losing trailing precision is fine.

Example fix

// before
field = { name = "rate", type = "decimal(10,9)" } // if scale > MAX_SCALE
// after
field = { name = "rate", type = "decimal(10,6)" } // scale clamped to MAX_SCALE
Defensive patterns

Strategy: validation

Validate before calling

if (dt.getScale() > MAX_SCALE) log.warn("scale {} exceeds SQL Server max {}; reduce in schema", dt.getScale(), MAX_SCALE);

Type guard

boolean fitsSqlServerScale(DecimalType dt) { return dt.getScale() <= 38 && dt.getScale() <= dt.getPrecision(); }

Prevention

When it happens

Trigger: reconvert sees DecimalType with scale > MAX_SCALE — e.g. decimal(38,40) or high-precision fractional values from engines that permit scale up to precision bounds larger than SQL Server's.

Common situations: Syncing high-precision financial data (e.g. decimal(20,19), or scale exceeding limits) into SQL Server; schemas copied from PostgreSQL NUMERIC with large scales.

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/8f99445a7acdbf21. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/sqlserver/SqlServerTypeConverter.java:390

                            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)", SQLSERVER_DECIMAL, precision, scale));
                builder.dataType(SQLSERVER_DECIMAL);
                builder.precision(precision);
                builder.scale(scale);
                break;
            case STRING:
                if (column.getColumnLength() == null || column.getColumnLength() <= 0) {
                    builder.columnType(MAX_NVARCHAR);

View on GitHub (pinned to cf67b549a7)