You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Vamsi Subhash Achanta (JIRA)" <ji...@apache.org> on 2018/10/25 19:47:00 UTC

[jira] [Commented] (AVRO-1571) Support parameterized types in Avro

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

Vamsi Subhash Achanta commented on AVRO-1571:
---------------------------------------------

Hi all,

I have worked on this and have a working solution with patch available in other JIRA:

https://issues.apache.org/jira/browse/AVRO-2248

Please review it. I am willing to make changes and work towards mainlining this. Please help. Thanks

> Support parameterized types in Avro
> -----------------------------------
>
>                 Key: AVRO-1571
>                 URL: https://issues.apache.org/jira/browse/AVRO-1571
>             Project: Avro
>          Issue Type: Bug
>    Affects Versions: 1.7.6, 1.7.7, 1.8.1
>            Reporter: Sachin Goyal
>            Priority: Major
>         Attachments: ParameterizedTypesTest.java
>
>
> The below code cannot be serialized by Avro.
> {code}
> class Leaf <P, Q> {
>   P p;
>   Q q;
> }
> class Root {
>   Middle1 m1;
>   Middle2 m2;
>   Middle3<Integer> m3;
> }
> class Middle1 {
>   Leaf <Integer, Long> foo;
> }
> class Middle2 {
>   Leaf <String, String> foo;
> }
> class Middle3 <P> {
>   Leaf <P, P> foo;
> }
> {code}
> This is because when generating the schema, only the current class is used to generate the schema.
> The parent class' context is missing in ReflectData#createSchema() functions where the actual type-information is actually present.
> Please see the attached test too for a simpler case.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)