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 # dev >> Avro enum and passivity.


Copy link to this message
-
Re: Avro enum and passivity.
On Mon, Jul 15, 2013 at 6:26 PM, Koduri,Vinay <[EMAIL PROTECTED]> wrote:
> We are relying on a inhouse framework that uses
> SpecificDatumReader(writternSchema, readerSchema) to read our avro objects
> from underlying store.

It occurs to me that all you really need to do is override
SpecificDatumReader#readEnum() to return null when the enum symbol is
not in the enum.

Perhaps you can change your in-house framework to, instead of
hardwiring SpecificDatumReader, to accept a GenericData instance and
call its createDatumReader() method.  The default would be to use
SpecificData.

Then you could pass your own subclass of SpecificData that returns a
subclass of SpecificDatumReader that overrides readEnum().

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