You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Antonio Piccolboni (JIRA)" <ji...@apache.org> on 2014/02/08 01:52:19 UTC

[jira] [Commented] (AVRO-1454) AvroAsTextInput format creates invalid JSON for NaN values

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

Antonio Piccolboni commented on AVRO-1454:
------------------------------------------

Doesn't seem to make any difference. Looked at the patch, can't see anything wrong with it. The output is the same, no quotes around "NaN". Can't share the test case, it's client data, need to create a different one.

> AvroAsTextInput format creates invalid JSON for NaN values
> ----------------------------------------------------------
>
>                 Key: AVRO-1454
>                 URL: https://issues.apache.org/jira/browse/AVRO-1454
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.5
>            Reporter: Antonio Piccolboni
>            Assignee: Doug Cutting
>             Fix For: 1.7.7
>
>         Attachments: AVRO-1454.patch
>
>
> The AvroAsTextInput format generates a record containing
> [omitted] , "someName": NaN}
> A json parser chokes on that and it is not legal JSON AFAIK. In related issues AVRO-972 and AVRO-1290 it is resolved, for lack of a better option, to map the value NaN to the string "NaN", which needs to be quoted in JSON. Our parser can handle that with no modifications, Java will parse such a string to the correct value using standard libraries.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)