[
https://issues.apache.org/jira/browse/AVRO-2072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16147229#comment-16147229
]
Zoltan Farkas edited comment on AVRO-2072 at 8/30/17 1:22 PM:
--------------------------------------------------------------
I executed this against my branch... which is ahead of the official branch in
certain places and behind in others...
THeese failures do highligh the need for this patch to contains some tests to
test the functionality.
TestReadingWritingDataInEvolvedSchemas.longWrittenWithUnionSchemaIsConvertedToFloatDoubleUnionSchema
highlights actually an interesting evolution case which the patch does not
cover:
{code}
int field -> union {float, double} field;
{code}
The test validates that int are promoted to double... meanwhile the patch
promotes it to float (first compatible type in the union)
I think the spec should be undated to clarify what needs to be done here...
was (Author: zolyfarkas):
I executed this against my branch... which is ahead of the official branch in
certain places and behind in others...
THeese failures do highligh the need for this patch to contains some tests to
test the functionality.
TestReadingWritingDataInEvolvedSchemas.longWrittenWithUnionSchemaIsConvertedToFloatDoubleUnionSchema
highlights actually an interesting evolution case which the patch does not
cover:
int field -> union {float, double} field;
The test validates that things are promoted to double... meanwhile the patch
promotes it to float (first compatible type in the union)
I think the spec should be undated to clarify what needs to be done here...
> 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)