Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase, mail # user - [Error]Finding average using hbase hadoop


Copy link to this message
-
Re: [Error]Finding average using hbase hadoop
manish dunani 2013-08-19, 14:01
I could not find it out!!

Can You just look at it !!

*Pastebin:*http://pastebin.com/pFKUhTgJ#

Tell me where i did mistake?
On Mon, Aug 19, 2013 at 7:16 PM, Jean-Marc Spaggiari <
[EMAIL PROTECTED]> wrote:

> Hi Manish,
>
> I did not even looked at it ;)
>
> Wha investigation have you done on your side to try to figure what the
> issue is?
>
> Have you add some logging to see the values before they are used to figure
> what they exactly are?
> Have you looked at some code to see what it's doing?
>
> What is the line 59 on your code?
>
> Also, as asked previously,  " can you please paste you code on pastbin?
> Same for the exception."? It's easier to look at it.
>
> JM
>
>
> 2013/8/19 manish dunani <[EMAIL PROTECTED]>
>
> > hello,
> > jean
> >
> > Did u find it??
> >
> >
> > On Sun, Aug 18, 2013 at 8:28 AM, manish dunani <[EMAIL PROTECTED]>
> > wrote:
> >
> > > But i want my output likewise::
> > >
> > >
> > > ROW                    CELL+COLUMN
> > >
> > > QXM                      column=stocks_output:average,
> > > timestamp=XXXXXXXXXX, val
> > >                       ue=XXXX
> > > QTM                      column=stocks_output:average,
> > > timestamp=XXXXXXXXXX, val
> > >                       ue=XXXX
> > >
> > >
> > > *sample dataset in hbase::**(table name:nyse4)*
> > >
> > >
> > >  2010-02-04           column=stocks:open, timestamp=1376567559424,
> > > value=2.5
> > >  2010-02-04           column=stocks:symbol, timestamp=1376567559424,
> > > value=QXM
> > >  2010-02-05           column=stocks:open, timestamp=1376567559429,
> > > value=2.42
> > >  2010-02-05           column=stocks:symbol, timestamp=1376567559429,
> > > value=QXM
> > >
> > >
> > > ===>>In my previous output i didn't get any symbol(qulifier)'s values
> in
> > > my table as Row key..
> > >
> > >
> > >
> > > hbase(main):004:0> scan 'nyse5'
> > > ROW                   COLUMN+CELL
> > > symbol               column=stocks_output:average,
> > > timestamp=1376749641978, val
> > >                       ue=@\xC6o\x11
> > >
> > > *So,that i changed my programme like wise::*
> > >
> > >
> > > package com.maddy;
> > >
> > > import java.io.IOException;
> > >
> > > import org.apache.hadoop.conf.Configuration;
> > > import org.apache.hadoop.fs.Path;
> > > import org.apache.hadoop.hbase.HBaseConfiguration;
> > > import org.apache.hadoop.hbase.client.Result;
> > > import org.apache.hadoop.hbase.client.Scan;
> > > import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter;
> > > import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
> > > import org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil;
> > > import org.apache.hadoop.hbase.mapreduce.TableMapper;
> > > import org.apache.hadoop.hbase.util.Bytes;
> > > //import org.apache.hadoop.io.DoubleWritable;
> > > import org.apache.hadoop.io.FloatWritable;
> > > import org.apache.hadoop.io.Text;
> > > import org.apache.hadoop.mapreduce.Job;
> > > import org.apache.hadoop.mapreduce.Reducer;
> > >
> > > import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
> > >
> > >
> > > public class openaveragestock
> > > {
> > >     public static class map extends TableMapper<Text,FloatWritable>
> > >     {
> > >         private static String col_family="stocks";
> > >         private static String qul="open";
> > >
> > >         private static String col_family1="stocks";
> > >         private static String qul1="symbol";
> > >
> > >         private static byte[] colfamily2=Bytes.toBytes(col_family);
> > >         private static byte[] qul2=Bytes.toBytes(qul);
> > >
> > >         private static byte[] colfamily3=Bytes.toBytes(col_family1);
> > >         private static byte[] qul3=Bytes.toBytes(qul1);
> > >
> > > //        public static float toFloat(int qul2)
> > > //        {
> > > //            return Float.intBitsToFloat((qul2));
> > > //
> > > //        }
> > > //
> > >         private static Text k1=new Text();
> > >
> > >
> > >
> > >         public void map(ImmutableBytesWritable row,Result value,Context
> >
Regards

*Manish Dunani*
*Contact No* : +91 9408329137
*skype id* : manish.dunani*
*