Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # user >> embed avro data in an envelop

Copy link to this message
Re: embed avro data in an envelop
Two suggested ways of doing this:

1. Create a record type for metadata; add a field to all existing schemas referencing that record type. Depending on your build process, you can probably keep the metadata schema in a separate file that is included into all the other schemas, so you don't need to duplicate it.

2. Create a wrapper type which includes the metadata, and has a "payload" field which is the union of all possible application schemas. In this case, all records in your system are of this wrapper type, and you have to look inside at the payload to see the actual content.

Basically, the choice is between 1. having the metadata inside the application record, or 2. having the application record inside the metadata/wrapper.


On 30 Apr 2014, at 02:14, Wai Yip Tung <[EMAIL PROTECTED]> wrote: