apache/seatunnel · warning

The decimal column {} type decimal({},{}) is out of range, w

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

MaxComputeTypeConverter.reconvert maps a SeaTunnel DecimalType column back to a MaxCompute decimal. A SeaTunnel decimal with precision <= 0 is invalid for MaxCompute, so the converter logs this warning and substitutes decimal(DEFAULT_PRECISION, DEFAULT_SCALE).

Source

Thrown at seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/datatype/MaxComputeTypeConverter.java:372

                break;
            case FLOAT:
                builder.nativeType(TypeInfoFactory.getPrimitiveTypeInfo(OdpsType.FLOAT));
                builder.columnType(FLOAT);
                builder.dataType(FLOAT);
                break;
            case DOUBLE:
                builder.nativeType(TypeInfoFactory.getPrimitiveTypeInfo(OdpsType.DOUBLE));
                builder.columnType(DOUBLE);
                builder.dataType(DOUBLE);
                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)

Solutions

  1. Fix the upstream schema to declare an explicit positive precision (e.g. decimal(38,10))
  2. Validate column types before writing to MaxCompute (reject precision <= 0 early)
  3. If the warning is expected, confirm the default decimal(p,s) substitution is acceptable
  4. Patch the producing component to never emit non-positive decimal precision

Example fix

// before
new DecimalType(0, 0) // triggers reconvert warning
// after
new DecimalType(38, 10)
Defensive patterns

Strategy: validation

Validate before calling

// validate SeaTunnel column before sink write
DecimalType dt = (DecimalType) column.getDataType();
if (dt.getPrecision() <= 0) throw new IllegalArgumentException("Column " + column.getName() + " needs explicit decimal precision");

Type guard

if (column.getDataType() instanceof DecimalType dt) { return dt.getPrecision() > 0; } return false;

Prevention

When it happens

Trigger: Calling reconvert on a CatalogColumn whose DecimalType has precision <= 0 (e.g. an unbounded/undefined decimal from upstream transforms or a bad schema definition).

Common situations: Upstream CDC/transform pipelines declaring DECIMAL without precision; schema inference producing decimal(0,0); hand-edited schema JSON.

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/14e135cef7fcbd23. Report an issue: GitHub.