Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 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
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
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB