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

Nandor Kollar commented on AVRO-2072:
-------------------------------------

[~zolyfarkas] I think this is fine, the test should expect float instead of 
Double in this case, since the spec says:

*if reader's is a union, but writer's is not*
The first schema in the reader's union that matches the writer's schema is 
recursively resolved against it. If none match, an error is signalled.

and int field will (with the attach patch) match with float branch now, and not 
with double. I think this is exactly what the spec says, no?

> ResolvingGrammarGenerator doesn't implement schema resolution correctly for 
> unions
> ----------------------------------------------------------------------------------
>
>                 Key: AVRO-2072
>                 URL: https://issues.apache.org/jira/browse/AVRO-2072
>             Project: Avro
>          Issue Type: Bug
>            Reporter: Nandor Kollar
>            Assignee: Nandor Kollar
>         Attachments: AVRO-2072.patch
>
>
> According to 
> [specification|https://avro.apache.org/docs/current/spec.html#Schema+Resolution],
>  int and long is promotable to float, but when using SchemaValidator, a union 
> with a single int or long branch is not readable by an union with a float 
> branch.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to