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

What it means

A DECIMAL column's precision exceeds SQL Server's maximum (38). reconvert reduces precision to MAX_PRECISION, shrinking scale by the same excess (clamped at 0), and logs a warning that the effective type differs from the requested one.

Solutions

  1. Reduce the source column precision to <= 38 in your schema definition.
  2. If values genuinely need more than 38 digits, pre-scale them (divide) or store as STRING in SQL Server.
  3. Accept the warning if truncation of precision headroom is acceptable.

Example fix

// before
field = { name = "amount", type = "decimal(50,20)" }
// after
field = { name = "amount", type = "decimal(38,8)" } // 38-20=18 excess shaved from scale
Defensive patterns

Strategy: validation

Validate before calling

if (dt.getPrecision() > 38) throw new IllegalArgumentException("SQL Server supports max precision 38; got " + dt.getPrecision() + " for " + col.getName());

Type guard

boolean fitsSqlServerDecimal(DecimalType dt) { return dt.getPrecision() > 0 && dt.getPrecision() <= 38; }

Prevention

When it happens

Trigger: Converting a DecimalType with precision > 38 (e.g. decimal(50,20) from sources like BigQuery/Oracle NUMBER or user config) into a SQL Server type.

Common situations: Syncing from engines that allow larger precisions (Hive/BigQuery/Postgres with big NUMERIC) into SQL Server; hand-written SeaTunnel schemas with over-large precisions.

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/0db13c74f31e0938. 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:366

                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(),
                            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(),

View on GitHub (pinned to cf67b549a7)