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

What it means

During reconvert, if a decimal column's precision exceeds the maximum precision Phoenix supports (MAX_PRECISION), the converter cannot map it faithfully. It logs this warning and clamps the precision to MAX_PRECISION, reducing the scale by the same amount (bounded at 0), which may cause silent precision loss when writing to Phoenix.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/phoenix/PhoenixTypeConverter.java:224

                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)

Solutions

  1. Reduce the decimal precision in the source/catalog to fit within Phoenix's MAX_PRECISION before sinking.
  2. Cast or round the column earlier in the pipeline (e.g. with a transform) to a smaller precision.
  3. Check the warning to confirm the clamped decimal(precision, scale) preserves enough fractional digits for your data.
  4. If wider precision is required, use a different sink that supports larger decimals.

Example fix

// before
new DecimalType(65, 30); // exceeds Phoenix max precision
// after
new DecimalType(38, 10); // fits within MAX_PRECISION
Defensive patterns

Strategy: validation

Validate before calling

DecimalType dt = (DecimalType) col.getDataType();
if (dt.getPrecision() > phoenixMaxPrecision) {
    col = CatalogColumn.of(col.getName(), new DecimalType(phoenixMaxPrecision, Math.max(0, dt.getScale() - (dt.getPrecision() - phoenixMaxPrecision))), col.isNullable(), col.getDefaultValue());
}

Type guard

boolean fitsPhoenixPrecision(CatalogColumn c) {
    return c.getDataType() instanceof DecimalType
        && ((DecimalType) c.getDataType()).getPrecision() <= 38; // Phoenix max
}

Prevention

When it happens

Trigger: Calling PhoenixTypeConverter.reconvert() on a CatalogColumn with DecimalType precision > MAX_PRECISION (e.g. DECIMAL(65,30)); happens in the sink schema-mapping path of the Phoenix connector.

Common situations: Sources that declare very wide decimals (e.g. MySQL DECIMAL(65,x), Hive/Spark DECIMAL(38+)) being written to Phoenix; schema evolution increasing precision beyond Phoenix's limit.

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