You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Werner Daehn (Jira)" <ji...@apache.org> on 2021/09/11 08:45:00 UTC

[jira] [Commented] (AVRO-2402) Generics, provide access to parent object

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

Werner Daehn commented on AVRO-2402:
------------------------------------

I have created a separate, small library for this, available via Maven Central.

https://github.com/rtdi/KafkaAvro

> Generics, provide access to parent object
> -----------------------------------------
>
>                 Key: AVRO-2402
>                 URL: https://issues.apache.org/jira/browse/AVRO-2402
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.10.0
>            Reporter: Werner Daehn
>            Priority: Critical
>         Attachments: AVRO-2402.patch
>
>
> (This is now the second project where I needed a functionality like this in Avro. Hence I would greatly appreciate it if you can add that to the 1.10.0 release. I took extra care to make it simple and without any side effects.)
>  
> Imagine you are within the GenericRecord Employee->Addresses. You have all fields of the Addresses Schema of course but what if you need to read something from the parent, the employee record? 
> You would need to remember the entire parent tree, which is fine if you are just one level deep but can be cumbersome when the structure is 10 levels deep.
> I'd like the GenericData.Record and Array to contain the method
>  * getParent()
> as well.
> With that you can easily walk the nested tree of a deeply nested Schema up and now down as well.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)