hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Marc Spaggiari <jean-m...@spaggiari.org>
Subject Re: Job MapReduce to populate HBase Table
Date Mon, 13 Apr 2015 11:01:06 GMT
Hi Silvio,

What is the key you try to write into your HBase table? From your code,
sound like you want your key to be null for all your values, which is not
possible in HBase.

JM

2015-04-13 6:37 GMT-04:00 Silvio Di gregorio <silvio.digregorio@gmail.com>:

> Hi,
> In Reduce phase when i write to Hbase Table "PFTableNa"
> context.write(null , put);
> Eclipse say me:
> *"The method write(ImmutableBytesWritable, Writable) in the type
> TaskInputOutputContext<Text,BytesWritable,ImmutableBytesWritable,Writable>
> is not applicable for the arguments (null, Put)"*
>
> *put *is org
>
> <eclipse-javadoc:%E2%98%82=LoadUnico/C:%5C/Users%5C/sdigregorio%5C/workspace-luna%5C/hbase-client-0.96.0-hadoop1.jar%3Corg>
> .apache
>
> <eclipse-javadoc:%E2%98%82=LoadUnico/C:%5C/Users%5C/sdigregorio%5C/workspace-luna%5C/hbase-client-0.96.0-hadoop1.jar%3Corg.apache>
> .hadoop
>
> <eclipse-javadoc:%E2%98%82=LoadUnico/C:%5C/Users%5C/sdigregorio%5C/workspace-luna%5C/hbase-client-0.96.0-hadoop1.jar%3Corg.apache.hadoop>
> .hbase
>
> <eclipse-javadoc:%E2%98%82=LoadUnico/C:%5C/Users%5C/sdigregorio%5C/workspace-luna%5C/hbase-client-0.96.0-hadoop1.jar%3Corg.apache.hadoop.hbase>
> .client
>
> <eclipse-javadoc:%E2%98%82=LoadUnico/C:%5C/Users%5C/sdigregorio%5C/workspace-luna%5C/hbase-client-0.96.0-hadoop1.jar%3Corg.apache.hadoop.hbase.client>
> .Put
>
> <eclipse-javadoc:%E2%98%82=LoadUnico/C:%5C/Users%5C/sdigregorio%5C/workspace-luna%5C/hbase-client-0.96.0-hadoop1.jar%3Corg.apache.hadoop.hbase.client(Put.class%E2%98%83Put>.Put(byte[]
> row)
> byte[] rowkey = key.getBytes();
> Put put = new Put(rowkey);
>
> the signature of the reduce method:
> reduce( Text key,Iterable<BytesWritable> values, Context context)
>
> and
>
> public static class Reduce extends TableReducer<Text, BytesWritable,
> ImmutableBytesWritable>{
>
> in the main method:
> Configuration conf = HBaseConfiguration.create();
> Job job = new Job(conf, "LetturaFileHDFS2HBase");
> ...
> TableMapReduceUtil.initTableReducerJob("PFTableNa", Reduce.class, job);
>
> Thanks a lot
> Silvio
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message