Description
The following code snippet in the Schema class shows that we explicitly treat Avro FLOAT and DOUBLE as a Java Double.
JsonNode defaultValue = field.get("default"); if (defaultValue != null && (Type.FLOAT.equals(fieldSchema.getType()) || Type.DOUBLE.equals(fieldSchema.getType())) && defaultValue.isTextual()) defaultValue = new DoubleNode(Double.valueOf(defaultValue.getTextValue()));
Jackson has support for FloatNode so why don't we use that?
This is a problem when someone calls Schema.Field#defaultVal for an Avro field with Avro type FLOAT and they try to typecast the object to a Java float.
Attachments
Issue Links
- incorporates
-
AVRO-1860 DefaultValue() returns Ints for Long fields
- Resolved