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 >> Re: How to convert Avro GenericRecord to AvroKey<GenericRecord>?


Copy link to this message
-
Re: How to convert Avro GenericRecord to AvroKey<GenericRecord>?
Ravi,

Moving this to the Avro user lists ([EMAIL PROTECTED]).

You can simply do a "AvroKey<GenericRecord> key = new
AvroKey<GenericRecord>(datum)".

On Thu, Sep 27, 2012 at 4:51 AM, Ravi P <[EMAIL PROTECTED]> wrote:
> Hello,
>   I am using Avro files for Hadoop MaprReduce.  My Mapper function has
> following definition.
>
> Mapper <AvroKey<GenericRecord>,NullWritable,
> AvroKey<GenericRecord>,AvroValue<GenericRecord>>
>
> For writing unit tests for above Mapper function I need to pass
> AvroKey<GenericRecord>.
> How do I convert GenericRecord to AvroKey<GenericRecord> ?
>
> Is there any example available ?
>
> Thanks,
> Ravi

--
Harsh J
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