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

WARN log from SapHanaTypeConverter.reconvert. When a DECIMAL column's precision is <= 0 (invalid for SAP HANA), the converter replaces it with DEFAULT_PRECISION/DEFAULT_SCALE and logs this warning instead of failing; the generated decimal(p,s) DDL uses the defaults.

Solutions

  1. Set an explicit positive precision on the decimal column in the source or a transform
  2. Pre-create the SAP HANA table with the intended DECIMAL(p,s) definition
  3. Accept the default precision/scale substitution if it fits your data

Example fix

// before: decimal with precision 0 from source metadata
// after: cast to explicit decimal in a transform
// sql = "SELECT CAST(amount AS DECIMAL(38,10)) AS amount FROM src"
Defensive patterns

Strategy: validation

Validate before calling

if (decimalType.getPrecision() <= 0) {
    // assign explicit precision/scale, e.g. DECIMAL(38,18), before the sink
}

Type guard

boolean hasValidPrecision(DecimalType t) { return t.getPrecision() > 0; }

Prevention

When it happens

Trigger: Sink-side type mapping where a DecimalType column reports precision <= 0; raised in reconvert() when building SAP HANA decimal column types.

Common situations: Sources or upstream transforms that produce decimal types with unset/zero precision (e.g. connectors with missing metadata, or decimal created without explicit 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/2f1d82ab89a0d693. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/saphana/SapHanaTypeConverter.java:359

                builder.columnType(HANA_BIGINT);
                builder.dataType(HANA_BIGINT);
                break;
            case FLOAT:
                builder.columnType(HANA_REAL);
                builder.dataType(HANA_REAL);
                break;
            case DOUBLE:
                builder.columnType(HANA_DOUBLE);
                builder.dataType(HANA_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)