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
Warning from YashanDbTypeConverter.reconvert when a DECIMAL column's scale is negative, which is invalid for YashanDB. The converter sets scale to 0 and continues, turning the column into an integer-valued decimal; only this warning is logged.
Solutions
- Remove the negative scale at the source: CAST(col AS DECIMAL(10,0)).
- Accept the scale=0 conversion if truncation of the rounded value semantics is acceptable.
- Define the YashanDB target column explicitly as DECIMAL(p,0).
Example fix
// before: decimal(10,-3) // after SQL: CAST(col AS DECIMAL(10,0)) AS col
Defensive patterns
Strategy: validation
Validate before calling
DecimalType d = (DecimalType) col.getDataType();
if (d.getScale() < 0) {
col = col.copy().setDataType(new DecimalType(d.getPrecision(), 0)).build();
} Type guard
boolean nonNegativeScale(DecimalType d) { return d.getScale() >= 0; } Prevention
- Avoid engines/configs that emit negative-scale decimals for target schemas
- Cast decimal(10,-3) to decimal(10,0) upstream
- Review source table DDL during pipeline design
When it happens
Trigger: Sink write of a DecimalType with negative scale (e.g. DECIMAL(10,-3), produced by some engines to mean rounding to thousands) into YashanDB.
Common situations: Schemas coming from engines that permit negative scale (Spark/Hive-style decimal(10,-3)); metadata round-trips that preserve negative scale.
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-19
- The column with type ARRAY will be converted to VECTOR in…
- The column with type will be converted to VECTOR in YashanDB
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/0cea9df535f06a27.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/yashandb/YashanDbTypeConverter.java:383
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)