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

RowTypeConverter.visit converts SeaTunnel DecimalType to Paimon DecimalType. A precision <= 0 is invalid; the converter replaces it with Paimon's DEFAULT_PRECISION/DEFAULT_SCALE and logs this warning so data still maps to a legal decimal column.

Solutions

  1. Fix the upstream schema to declare decimal(p,s) with p >= 1.
  2. Explicitly define the column type in your job schema (e.g. DECIMAL(20,4)) to bypass inference.
  3. Accept the fallback decimal(10,0)-style defaults if precision was unknown, but verify values still fit.
  4. Patch the source connector's type conversion if it routinely emits precision 0.

Example fix

// before
DecimalType(0, 0)
// after
DecimalType(10, 0)  // or real precision like (20,4)
Defensive patterns

Strategy: validation

Validate before calling

if (decimalType.getPrecision() <= 0) decimalType = new DecimalType(10, 0); // fix before sink

Type guard

boolean isLegalDecimal(DecimalType t) { return t != null && t.getPrecision() > 0; }

Prevention

When it happens

Trigger: A catalog table column carries DecimalType with precision 0 or negative (e.g. decimal(0,0) from upstream metadata) while RowTypeConverter builds the Paimon row type.

Common situations: JDBC/other source returning unnormalized decimal metadata; hand-written SeaTunnel schema with decimal(0,s); schema inference producing placeholder 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/a5453affbf0eb161. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/utils/RowTypeConverter.java:327

                    return builder.build();
                case TIME:
                    int timeScale = Objects.isNull(scale) ? TimeType.DEFAULT_PRECISION : scale;
                    TimeType timeType = DataTypes.TIME(timeScale);
                    builder.nativeType(timeType.copy(column.isNullable()));
                    builder.columnType(timeType.toString());
                    builder.dataType(timeType.getTypeRoot().name());
                    builder.scale(timeScale);
                    builder.length(column.getColumnLength());
                    return builder.build();
                case DECIMAL:
                    org.apache.seatunnel.api.table.type.DecimalType seatunnelDecimalType =
                            (org.apache.seatunnel.api.table.type.DecimalType) dataType;
                    int precision = seatunnelDecimalType.getPrecision();
                    scale = seatunnelDecimalType.getScale();
                    if (precision <= 0) {
                        precision = DecimalType.DEFAULT_PRECISION;
                        scale = DecimalType.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(),
                                seatunnelDecimalType.getPrecision(),
                                seatunnelDecimalType.getScale(),
                                precision,
                                scale);
                    } else if (precision > DecimalType.MAX_PRECISION) {
                        scale = (int) Math.max(0, scale - (precision - DecimalType.MAX_PRECISION));
                        precision = DecimalType.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(),
                                seatunnelDecimalType.getPrecision(),
                                seatunnelDecimalType.getScale(),

View on GitHub (pinned to cf67b549a7)