avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoltan Farkas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-2072) ResolvingGrammarGenerator doesn't implement schema resolution correctly for unions
Date Wed, 30 Aug 2017 13:21:01 GMT

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

Zoltan Farkas commented on AVRO-2072:
-------------------------------------

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)

Mime
View raw message