apache/seatunnel · error · IllegalArgumentException
Unsupported FloatingPoint precision:
Error message
Unsupported FloatingPoint precision:
What it means
FloatingPointTypeWriter.writeToVector maps Arrow FloatingPoint precision to Float4Vector (SINGLE) or Float8Vector (DOUBLE). Arrow defines only HALF/SINGLE/DOUBLE; HALF is not handled, so a HALF precision field reaches the else branch and throws IllegalArgumentException. It means the writer cannot serialize the float value into a vector of that precision.
Source
Thrown at seatunnel-connectors-v2/connector-lance/src/main/java/org/apache/seatunnel/connectors/seatunnel/lance/sink/writers/FloatingPointTypeWriter.java:45
import org.apache.arrow.vector.types.pojo.ArrowType;
/** Writer for FloatingPoint type. */
public class FloatingPointTypeWriter extends BaseTypeWriter {
@Override
public void writeToVector(
FieldVector vector,
ArrowType arrowType,
Object value,
int rowIndex,
BufferAllocator allocator) {
ArrowType.FloatingPoint fpType = (ArrowType.FloatingPoint) arrowType;
Number numValue = (Number) value;
if (fpType.getPrecision() == FloatingPointPrecision.SINGLE) {
((Float4Vector) vector).setSafe(rowIndex, numValue.floatValue());
} else if (fpType.getPrecision() == FloatingPointPrecision.DOUBLE) {
((Float8Vector) vector).setSafe(rowIndex, numValue.doubleValue());
} else {
throw new IllegalArgumentException(
"Unsupported FloatingPoint precision: " + fpType.getPrecision());
}
}
@Override
public void writeToListWriter(
UnionListWriter writer, ArrowType arrowType, Object value, BufferAllocator allocator) {
ArrowType.FloatingPoint fpType = (ArrowType.FloatingPoint) arrowType;
Number numValue = (Number) value;
if (fpType.getPrecision() == FloatingPointPrecision.SINGLE) {
writer.writeFloat4(numValue.floatValue());
} else if (fpType.getPrecision() == FloatingPointPrecision.DOUBLE) {
writer.writeFloat8(numValue.doubleValue());
}
}
@Override
public void writeToMapKey(View on GitHub (pinned to cf67b549a7)
Solutions
- Change the target column to SINGLE (float4) or DOUBLE (float8) precision, recreating the dataset if needed.
- Cast half-float values to float in the upstream transform before the sink.
- Upgrade the connector if Float16 support is added in a newer version.
Example fix
// before new ArrowType.FloatingPoint(FloatingPointPrecision.HALF) // after new ArrowType.FloatingPoint(FloatingPointPrecision.SINGLE)
Defensive patterns
Strategy: validation
Validate before calling
ArrowType t = field.getType(); if (t instanceof ArrowType.FloatingPoint && ((ArrowType.FloatingPoint) t).getPrecision() == FloatingPointPrecision.HALF) throw new IllegalArgumentException("HALF float not supported by lance sink"); Try / catch
try { writer.write(row); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith("Unsupported FloatingPoint precision")) { /* recast column to SINGLE/DOUBLE */ } throw e; } Prevention
- Avoid half-float (Float16) columns in datasets written by this sink.
- Use SINGLE or DOUBLE precision when creating the dataset schema.
- Cast ML/embedding vectors from float16 to float32 upstream.
When it happens
Trigger: A field's ArrowType is FloatingPoint with precision HALF (Float16) and writeToVector is called for it.
Common situations: Dataset schema created externally with half-float columns (common in ML/embedding data stored in Lance) being written by this SeaTunnel connector, which lacks Float16 support.
Related errors
- List type should be handled via FragmentConverter.writeListT
- Nested list writing not yet implemented
- TABLE_DATASET_WRITE_ST_ROW_EXCEPTION
- Unsupported timestamp value type:
- Unsupported Date unit:
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/4ee498adb97a9e3f.
Report an issue: GitHub.