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
- Fix the upstream source/schema so the decimal precision is a positive value (e.g. DECIMAL(10,2) instead of DECIMAL(0,0)).
- 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.
- Review the warning log to identify which column is affected and confirm the default decimal (DEFAULT_PRECISION/DEFAULT_SCALE) is acceptable for your data.
- 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
- Always declare decimal columns with explicit positive precision
- Validate source schemas before running pipelines
- Watch for log.warn output about decimal conversion during dev runs
- Pin precision/scale in catalog definitions rather than relying on inference
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
- The decimal column {} type decimal({},{}) is out of range, w
- The decimal column {} type decimal({},{}) is out of range, w
- The decimal column {} type decimal({},{}) is out of range, w
- COMMON-17
- COMMON-17
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/0def382e078d09cb.
Report an issue: GitHub.