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

Switch to Threaded View
Avro, mail # user - Nesting avro with avro or proto binary represenations


Copy link to this message
-
Re: Nesting avro with avro or proto binary represenations
Doug Cutting 2012-02-16, 15:55
On 02/15/2012 08:23 PM, Shirahatti, Nikhil wrote:
> My question is whether we can use an avro schema as a wrapper for
> another avro/protobuf binary representation.

Yes, that can certainly be done.

A case I've heard where something like this might be useful is query
results.  For example one might have a results schema like:

{"type": "record", "name":"results", "fields": [
  {"name":"schema", "type":"string"},
  {"name":"values", "type": {"type":"array", "Items":"bytes"}}
]}

For a query that contains the equivalent of 'SELECT (DATE, ID)' the
value of the "schema" field in the results might then be something like:

{"type": "record", "name":"result", "fields": [
  {"name":"date", "type":"long"},
  {"name":"id", "type": "int"}
]}

Doug