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

When converting a SeaTunnel DecimalType column back to the Phoenix JDBC type, the converter validates the decimal precision. A precision of 0 or less is invalid for Phoenix DECIMAL columns, so the converter does not throw; it logs this warning and silently substitutes the default precision/scale (DEFAULT_PRECISION/DEFAULT_SCALE). Data written afterward uses the substituted type, which may lose the intended schema fidelity.

Source

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

                builder.columnType(PHOENIX_BIGINT);
                builder.dataType(PHOENIX_BIGINT);
                break;
            case FLOAT:
                builder.columnType(PHOENIX_FLOAT);
                builder.dataType(PHOENIX_FLOAT);
                break;
            case DOUBLE:
                builder.columnType(PHOENIX_DOUBLE);
                builder.dataType(PHOENIX_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 source/schema so the decimal precision is a positive value (e.g. DECIMAL(10,2) instead of DECIMAL(0,0)).
  2. If precision is genuinely unknown, explicitly declare the column with a concrete precision in your SeaTunnel config or catalog table before it reaches the Phoenix sink.
  3. Review the warning log to identify which column is affected and confirm the default decimal (DEFAULT_PRECISION/DEFAULT_SCALE) is acceptable for your data.
  4. If you need different defaults, adjust/override DEFAULT_PRECISION and DEFAULT_SCALE in PhoenixTypeConverter.

Example fix

// before (source schema)
catalogColumn = CatalogColumn.of("amount", DecimalType(0, 0));
// after
catalogColumn = CatalogColumn.of("amount", new DecimalType(10, 2));
Defensive patterns

Strategy: validation

Validate before calling

CatalogColumn col = ...;
DecimalType dt = (DecimalType) col.getDataType();
if (dt.getPrecision() <= 0) {
    col = CatalogColumn.of(col.getName(), new DecimalType(10, 2), col.isNullable(), col.getDefaultValue());
}

Type guard

boolean isValidDecimal(CatalogColumn c) {
    return c.getDataType() instanceof DecimalType
        && ((DecimalType) c.getDataType()).getPrecision() > 0;
}

Prevention

When it happens

Trigger: Calling PhoenixTypeConverter.reconvert() (via the Phoenix dialect's toConnectorType/convert paths) on a CatalogColumn whose DecimalType has precision <= 0, e.g. a decimal built programmatically or read from a source that reports precision 0.

Common situations: Catalog columns populated by custom sources or auto-generated schemas where decimal precision was never set (defaulting to 0); upstream schema inference returning precision 0 for numeric columns.

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