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

Ryan Blue commented on AVRO-1604:
---------------------------------

[~ericsodt], I think the schema you've generated looks correct. This issue 
addressed an error thrown when generating the schema. But your schema appears 
to have been generated without errors and looks fine.

The problem that you're hitting is because your JSON doesn't conform to Avro's 
[JSON encoding 
spec|https://avro.apache.org/docs/1.7.7/spec.html#json_encoding]. The union 
should have an extra layer to tell Avro which type in the union should be used. 
You can also use other utilities to do this conversion. Kite, for example, has 
support for converting non-Avro JSON records to Avro.

> ReflectData.AllowNull fails to generate schemas when @Nullable is present.
> --------------------------------------------------------------------------
>
>                 Key: AVRO-1604
>                 URL: https://issues.apache.org/jira/browse/AVRO-1604
>             Project: Avro
>          Issue Type: Bug
>            Reporter: Ryan Blue
>            Assignee: Ryan Blue
>             Fix For: 1.8.0
>
>         Attachments: AVRO-1604-1.patch
>
>
> The {{@Nullable}} annotation causes a failure because the 
> {{makeNullable(Schema)}} method assumes that the type passed in is not 
> already a union. When it is a union, either from using {{Nullable}}, 
> {{AvroSchema}}, or a {{Union}}-annotated type, an exception is thrown that 
> unions can't contain unions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to