When a Java float or double value contains a non-finite value (Infinity, -Infinity, NaN) it is serialized in JSON as a String instead of a number (e.g. 3.1416), as JSON numbers do not support non-finite values.
If we try to convert a JSON with such values to AVRO it will fail.
We have added support in JsonGenericRecordReader to support parsing float and double numbers as strings so "NaN", "Infinite" and "-Infinite" are now parseable.
When a Java
float
ordouble
value contains a non-finite value (Infinity
,-Infinity
,NaN
) it is serialized in JSON as a String instead of a number (e.g.3.1416
), as JSON numbers do not support non-finite values.If we try to convert a JSON with such values to AVRO it will fail.
We have added support in
JsonGenericRecordReader
to support parsingfloat
anddouble
numbers as strings so"NaN"
,"Infinite"
and"-Infinite"
are now parseable.