You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by ๏̯͡๏ <ÐΞ€ρ@Ҝ>, de...@gmail.com on 2014/01/21 16:15:51 UTC

Re: Avro Array and combining schema ?

+dev list.


On Tue, Jan 21, 2014 at 8:02 PM, ÐΞ€ρ@Ҝ (๏̯͡๏) <de...@gmail.com> wrote:

> I have two schemas as follow
>
> 1) Event.avsc
>
> {
>
>     "type": "record", "namespace":"com.nrt.datum.avro", "name" : "Event",
>
>     "fields": [
>
>             {"name" : "guid", "type": ["string", "null"]},
>
>             {"name" : "moreId", "type": ["int", "null"]}
>
>        ]
>
> }
>
> 2. Session.avsc
>
> {
>
>     "type": "record", "namespace":"com.nrt.datum.avro", "name" :
> "Session",
>
>     "fields": [
>
>              {"name" : "isClosed", "type": "boolean"},
>
>              {"name" : "guid", "type": ["string", "null"]}
>
>  ]
>
> }
>
>
> 1) I want to define a third schema that should SessionContainer, that
> should have all the fields of schema and an array (List) of Event. How do i
> write SessionContainer.avsc  ?
> 2) If i could refer Event.avsc and Session.avsc in SessionContainer.avsc
> then if i change Event/Session, i do not have to change SessionContainer.
>
> I use Java + Avro.
> Any suggestions ?
>
> --
> Deepak
>
>


-- 
Deepak