Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1B62A17E6B for ; Mon, 13 Apr 2015 12:24:49 +0000 (UTC) Received: (qmail 25002 invoked by uid 500); 13 Apr 2015 12:24:41 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 24928 invoked by uid 500); 13 Apr 2015 12:24:41 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 24916 invoked by uid 99); 13 Apr 2015 12:24:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2015 12:24:40 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of silvio.digregorio@gmail.com designates 209.85.213.176 as permitted sender) Received: from [209.85.213.176] (HELO mail-ig0-f176.google.com) (209.85.213.176) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2015 12:24:15 +0000 Received: by igblo3 with SMTP id lo3so43539851igb.1 for ; Mon, 13 Apr 2015 05:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=eMjDZZrDsJ6OdQdnhZmigD2kMLnw7Kzi2fl+qpQ1JO0=; b=KMLqt6aGzfCKQSBFTI5F2mh1ktI9QrWrqnlg9vBx7nlfcoYBJNmkCLk1vPxnqMOEDP jA4/OWyBp848+w/S1kegWJDmMxpBRL0JkLG7E6FjTgQlHwgdRhU8DfvUL50Lu/CohSuh 4xDvI/VMz4Ks2ZNrfFHaUXrlmBts2YMB5b0uJDSxX9CUTWYkRqRBZHjh6g8D+pj4hmB2 Tp7Agy0PS2g3uzO7m4ZzJwHbNQGGLfsAANl3fPCvJ4iVvayqksq4VJPcUrBtIM+E6fNr OoRtOHeajRSa4qSxfi0SSKc6E9RNbCX7A29OQTIpvMm7aCtkSklt91Vh40Dlu3Q9XWzB 61ww== MIME-Version: 1.0 X-Received: by 10.107.130.165 with SMTP id m37mr19951080ioi.62.1428927718341; Mon, 13 Apr 2015 05:21:58 -0700 (PDT) Received: by 10.107.137.29 with HTTP; Mon, 13 Apr 2015 05:21:58 -0700 (PDT) In-Reply-To: References: Date: Mon, 13 Apr 2015 14:21:58 +0200 Message-ID: Subject: Re: Job MapReduce to populate HBase Table From: Silvio Di gregorio To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=001a113eb98a0fc16205139a29f7 X-Virus-Checked: Checked by ClamAV on apache.org --001a113eb98a0fc16205139a29f7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable the signature of the write method is: write(ImmutableBytesWritable arg0, Writable arg1) arg0 don't accept NulWritable.get(), instead "null" 2015-04-13 14:13 GMT+02:00 Silvio Di gregorio = : > in documentation (http://hbase.apache.org/0.94/book/mapreduce.example.htm= l), > when the Reduce extends the TableReducer class the write method > put the key null, or rather NullWritable like Shahab Say. > However, the error has disappeared when i removed the > "hbase-client-0.96.0-hadoop1.jar" and inserted "hbase-0.94.6-cdh4.3.0.ja= r". > Sorry but i don't understand, I knew only that the Context object had not > accepted a PUT where was required WRITABLE with the > "hbase-client-0.96.0-hadoop1.jar" jar in classpath. With the > "hbase-0.94.6-cdh4.3.0.jar" it is possible. > > 2015-04-13 13:52 GMT+02:00 Jean-Marc Spaggiari : > >> Oh, Shahab is write! That's what happend when you write emails before yo= ur >> coffee ;) I confused with your "Put" key ;) Looked to quickly... >> >> JM >> >> 2015-04-13 7:46 GMT-04:00 Shahab Yunus : >> >> > For the null key you should use NullWritable class, as discussed here: >> > >> > >> http://stackoverflow.com/questions/16198752/advantages-of-using-nullwrit= able-in-hadoop >> > >> > Regards, >> > Shahab >> > >> > On Mon, Apr 13, 2015 at 7:01 AM, Jean-Marc Spaggiari < >> > jean-marc@spaggiari.org> wrote: >> > >> > > 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 i= s >> 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 >> > > > is not applicable for the arguments (null, Put)"* >> > > > >> > > > *put *is org >> > > > >> > > > >> > > >> > >> >> > > > .apache >> > > > >> > > > >> > > >> > >> >> > > > .hadoop >> > > > >> > > > >> > > >> > >> >> > > > .hbase >> > > > >> > > > >> > > >> > >> >> > > > .client >> > > > >> > > > >> > > >> > >> >> > > > .Put >> > > > >> > > > >> > > >> > >> .Put(byte[] >> > > > row) >> > > > byte[] rowkey =3D key.getBytes(); >> > > > Put put =3D new Put(rowkey); >> > > > >> > > > the signature of the reduce method: >> > > > reduce( Text key,Iterable values, Context context) >> > > > >> > > > and >> > > > >> > > > public static class Reduce extends TableReducer> > > > ImmutableBytesWritable>{ >> > > > >> > > > in the main method: >> > > > Configuration conf =3D HBaseConfiguration.create(); >> > > > Job job =3D new Job(conf, "LetturaFileHDFS2HBase"); >> > > > ... >> > > > TableMapReduceUtil.initTableReducerJob("PFTableNa", Reduce.class, >> job); >> > > > >> > > > Thanks a lot >> > > > Silvio >> > > > >> > > >> > >> > > --001a113eb98a0fc16205139a29f7--