apache/beam · error · IllegalArgumentException
Unsupported floating-point precision: ${type.getPrecision().
Error message
Unsupported floating-point precision: ${type.getPrecision().name()} What it means
Thrown when converting an Arrow FloatingPoint type to a Beam FieldType and the precision is neither SINGLE nor DOUBLE (i.e. HALF float). Beam's schema model in this converter only supports 32-bit FLOAT and 64-bit DOUBLE.
Source
Thrown at sdks/java/extensions/arrow/src/main/java/org/apache/beam/sdk/extensions/arrow/ArrowConversion.java:201
case 32:
return FieldType.INT32;
case 64:
return FieldType.INT64;
default:
throw new IllegalArgumentException(
"Unsupported integer bit width: " + type.getBitWidth());
}
}
@Override
public FieldType visit(ArrowType.FloatingPoint type) {
switch (type.getPrecision()) {
case SINGLE:
return FieldType.FLOAT;
case DOUBLE:
return FieldType.DOUBLE;
default:
throw new IllegalArgumentException(
"Unsupported floating-point precision: " + type.getPrecision().name());
}
}
@Override
public FieldType visit(ArrowType.Utf8 type) {
return FieldType.STRING;
}
@Override
public FieldType visit(ArrowType.Utf8View type) {
throw new IllegalArgumentException(
"Type \'" + type.toString() + "\' not supported.");
}
@Override
public FieldType visit(ArrowType.Binary type) {
return FieldType.BYTES;View on GitHub (pinned to 12126d8942)
Solutions
- Change the Arrow column to FLOAT (SINGLE) or DOUBLE precision before conversion.
- Pre-convert HALF floats to DOUBLE in the producer or with an Arrow compute cast.
- Patch the visitor to map HALF to FieldType.FLOAT or DOUBLE (accepting precision loss) if upstream Beam does not support half floats.
Example fix
// before
Field v = Field.nullable("v", ArrowType.FloatingPoint.HALF);
// after
Field v = Field.nullable("v", ArrowType.FloatingPoint.DOUBLE); // SINGLE also works Defensive patterns
Strategy: validation
Validate before calling
for (Field f : schema.getFields()) {
if (f.getType() instanceof ArrowType.FloatingPoint
&& ((ArrowType.FloatingPoint) f.getType()).getPrecision() == FloatingPointPrecision.HALF) {
throw new IllegalArgumentException(
"Column " + f.getName() + " is HALF float; cast to SINGLE or DOUBLE before conversion");
}
} Type guard
boolean isConvertibleFloat(ArrowType t) {
return t instanceof ArrowType.FloatingPoint
&& ((ArrowType.FloatingPoint) t).getPrecision()
!= FloatingPointPrecision.HALF;
} Try / catch
try {
Schema beamSchema = ArrowConversion.toBeamSchema(arrowSchema);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("Unsupported floating-point precision")) {
arrowSchema = castHalfToDouble(arrowSchema); // then retry
} else { throw e; }
} Prevention
- Keep FP16 data outside Beam ingestion paths; cast to float/double at export time.
- Document supported Arrow types for your pipeline and validate input files early.
- Test conversion with a sample batch before running full pipelines.
When it happens
Trigger: Converting an Arrow schema/VectorSchemaRoot containing a FloatingPoint type with precision FloatingPointPrecision.HALF (16-bit float) to a Beam Schema.
Common situations: Half-precision columns produced by ML pipelines (FP16 model weights/embeddings), or GPU-generated Arrow data, fed into a Beam ArrowIO pipeline.
Related errors
- Unsupported integer bit width: ${type.getBitWidth()}
- Unsupported timestamp unit: ${type.getUnit().name()}
- Illegal access to pipeline after visitor traversal was compl
- Pipeline update will not be possible because the following t
- Unrecognized value for stable unique names:
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/f3d33e86520ff148.
Report an issue: GitHub.