[ 
https://issues.apache.org/jira/browse/AVRO-1466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13934137#comment-13934137
 ] 

Doug Cutting commented on AVRO-1466:
------------------------------------

The fundamental problem is that JSON does not support NaN or Infinity values.

One might automatically convert the strings, "NaN", "Infinity", and "-Infinity" 
to numbers.  This could cause some odd surprises, so should probably be avoided.

Instead we could configure Jackson (the JSON parser/printer library we use) to 
print and these, producing invalid JSON.  But we should only do this as an 
option, so that we continue to generate valid JSON by default.  So we might add 
a '--nan' option to the 'tojson' and 'fromjson' commands to cause it to 
generate and accept such non-standard JSON.  Would that be of interest?


> Avro Tools fromjson (ie JsonDecoder) cannot parse "NaN" values created by 
> tojson (ie JsonEncoder)
> -------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-1466
>                 URL: https://issues.apache.org/jira/browse/AVRO-1466
>             Project: Avro
>          Issue Type: Bug
>    Affects Versions: 1.7.6
>            Reporter: Jamie Olson
>
> Avro files containing NaN values are converted to JSON as a string "NaN" by 
> Avro Tools tojson command (ie JsonEncoder).  These values cannot be parsed by 
> the Avro Tools fromjson command (ie JsonDecoder.readDouble).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to