apache/seatunnel · warning

{} will probably cause value overflow.

Error message

{} will probably cause value overflow.

What it means

MaxComputeTypeConverter.convert maps a MaxCompute DECIMAL column to a SeaTunnel DecimalType. When the source decimal's precision exceeds DEFAULT_PRECISION (the converter's max supported precision), it logs this warning and downgrades the type to decimal(DEFAULT_PRECISION, DEFAULT_SCALE), which can silently truncate/overflow values.

Source

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

            valueDefine.setNativeType(((MapTypeInfo) nativeType).getValueTypeInfo());
            Column valueColumn = convert(valueDefine);
            MapType mapType = new MapType(keyColumn.getDataType(), valueColumn.getDataType());
            return new PhysicalColumn(
                    typeDefine.getName(),
                    mapType,
                    typeDefine.getLength(),
                    typeDefine.getScale(),
                    typeDefine.isNullable(),
                    typeDefine.getDefaultValue(),
                    typeDefine.getComment(),
                    typeDefine.getNativeType().getTypeName(),
                    new HashMap<>());
        }

        if (typeDefine.getNativeType() instanceof DecimalTypeInfo) {
            DecimalType decimalType;
            if (((DecimalTypeInfo) typeDefine.getNativeType()).getPrecision() > DEFAULT_PRECISION) {
                log.warn("{} will probably cause value overflow.", DECIMAL);
                decimalType = new DecimalType(DEFAULT_PRECISION, DEFAULT_SCALE);
            } else {
                decimalType =
                        new DecimalType(
                                ((DecimalTypeInfo) typeDefine.getNativeType()).getPrecision(),
                                ((DecimalTypeInfo) typeDefine.getNativeType()).getScale());
            }
            builder.dataType(decimalType);
            builder.columnLength((long) decimalType.getPrecision());
            builder.scale(decimalType.getScale());
        } else if (typeDefine.getNativeType() instanceof AbstractCharTypeInfo) {
            // CHAR(n) or VARCHAR(n)
            builder.columnLength(
                    TypeDefineUtils.charTo4ByteLength(
                            (long)
                                    ((AbstractCharTypeInfo) typeDefine.getNativeType())
                                            .getLength()));
            builder.dataType(BasicType.STRING_TYPE);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the source table's decimal precision and compare against the converter's DEFAULT_PRECISION
  2. Reduce the source column precision to fit within the supported maximum, or cast in SQL before the connector reads it
  3. Upgrade/patch MaxComputeTypeConverter to raise DEFAULT_PRECISION if the backend supports it
  4. Use a STRING column type in the source if exact large-decimal values must be preserved

Example fix

// before
DECIMAL(40, 5) col // exceeds DEFAULT_PRECISION, downgraded with warning
// after
CAST(col AS DECIMAL(38, 5)) AS col -- within supported precision
Defensive patterns

Strategy: validation

Validate before calling

// before reading, check source decimal precision
if (((DecimalTypeInfo) typeInfo).getPrecision() > 38) {
    throw new IllegalArgumentException("Decimal precision exceeds supported max; cast source column");
}

Prevention

When it happens

Trigger: Converting a table schema containing a DECIMAL(p,s) column where p > DEFAULT_PRECISION during convert (invoked directly, or from arrayColumn/keyColumn/valueColumn for nested columns).

Common situations: MaxCompute tables using large decimals (e.g. decimal(38,x)) where the connector default is lower; users unaware the connector caps decimal precision; data loss discovered only when reading values back.

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/876ee1d3232d525f. Report an issue: GitHub.