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 scale less than 0, it will be converted to decimal({},{}) What it means
While converting a DECIMAL column for Snowflake, the column's scale is negative, which Snowflake does not support. SeaTunnel resets the scale to 0 (keeping the resolved precision) and logs this warning, effectively converting to an integer-valued decimal.
Solutions
- Use a non-negative scale on the source decimal column.
- Pre-create the Snowflake table so no automatic conversion happens, and cast values explicitly.
- Verify the data fits an integer-scaled decimal after rounding; if fractional parts matter, remap the column as STRING.
- Accept the warning if rounding to scale 0 is acceptable.
Example fix
// before new DecimalType(10, -3) // after new DecimalType(10, 0)
Defensive patterns
Strategy: validation
Validate before calling
DecimalType dt = (DecimalType) column.getDataType();
if (dt.getScale() < 0) {
log.warn("Column {} has negative scale {}; will become 0",
column.getName(), dt.getScale());
} Type guard
boolean hasNonNegativeScale(Column c) {
return !(c.getDataType() instanceof DecimalType)
|| ((DecimalType) c.getDataType()).getScale() >= 0;
} Prevention
- Avoid negative-scale decimals (NUMBER(p,-n)) when targeting Snowflake
- Round/normalize scale at the source before sync
- Map such columns to STRING if rounding is unacceptable
When it happens
Trigger: reconvert() sees DecimalType with scale < 0 — possible after precision clamping reduced scale below zero, or when source metadata declares a negative scale (some engines allow negative scale for rounding decimals).
Common situations: Sources like Oracle/MySQL with NUMBER(p,-n) or decimal columns with negative scale; downstream effect of error 3501's clamping logic on columns with small scale and huge 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
- The decimal column type decimal( , ) is out of range, which…
- COMMON-17
- COMMON-17
- The decimal column type decimal( , ) is out of range, which…
- The decimal column type decimal( , ) is out of range, which…
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/2cb1cc5ac5e5ddf4.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/snowflake/SnowflakeTypeConverter.java:244
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(),
decimalType.getScale(),
precision,
scale);
} else if (scale > MAX_SCALE) {
scale = MAX_SCALE;
log.warn(
"The decimal column {} type decimal({},{}) is out of range, "
+ "which exceeds the maximum scale of {}, "
+ "it will be converted to decimal({},{})",
column.getName(),
decimalType.getPrecision(),
decimalType.getScale(),
MAX_SCALE,View on GitHub (pinned to cf67b549a7)