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

Switch to Plain View
HBase >> mail # user >> BigDecimalColumnInterpreter


+
Julian Wissmann 2012-09-05, 16:17
+
Ted Yu 2012-09-05, 16:22
+
Julian Wissmann 2012-09-05, 19:07
+
Ted Yu 2012-09-05, 19:22
+
Julian Wissmann 2012-09-05, 19:49
+
Ted Yu 2012-09-05, 20:04
+
Julian Wissmann 2012-09-05, 20:30
Copy link to this message
-
Re: BigDecimalColumnInterpreter
Hi Julian,

I have been running the same class on my distributed cluster for
aggregation. It has been working fine. The only difference is that i use
the methods provided incom.intuit.ihub.hbase.poc.aggregation.client.
AggregationClient<eclipse-javadoc:%E2%98%82=Hbase_cdh4/src%3Ccom.intuit.ihub.hbase.poc.aggregation.client%7BAggregationClient.java%E2%98%83AggregationClient>class.
IMHO, you don't need to define an Endpoint for using the
BigDecimalColumnInterpreter.

You need to use methods of AggregationClient: sum(Bytes.toBytes(tableName),
ci, scan), avg(final byte[] tableName, final ColumnInterpreter<R, S> ci,
Scan scan), etc.

In the above method you just need to pass the BigDecimalColumnInterpreter,
Scan object and Byte Array of TableName. It should work. Let me know if it
doesn't work this way.*
*
Thanks,
Anil Gupta*
*

On Wed, Sep 5, 2012 at 1:30 PM, Julian Wissmann <[EMAIL PROTECTED]>wrote:

> Thank you!
> So this looks like the missing link here.
> I'll see if I can get it working, tomorrow morning.
>
> Cheers
>
> 2012/9/5 Ted Yu <[EMAIL PROTECTED]>
>
> > I added one review comment on
> > HBASE-6669<https://issues.apache.org/jira/browse/HBASE-6669>
> > .
> >
> > Thanks Julian for reminding me.
> >
> > On Wed, Sep 5, 2012 at 12:49 PM, Julian Wissmann
> > <[EMAIL PROTECTED]>wrote:
> >
> > > I get supplied with doubles from sensors, but in the end I loose too
> much
> > > precision if I do my aggregations on double, otherwise I'd go for it.
> > > I use 0.92.1, from Cloudera CDH4.
> > > I've done some initial testing with LongColumnInterpreter on a dataset
> > that
> > > I've generated, to do some testing and get accustomed to stuff, but
> that
> > > worked like a charm after some initial stupidity on my side.
> > > So now I'm trying to do some testing with the real data, which comes in
> > as
> > > double and gets parsed to BigDecimal before writing.
> > >
> > > 2012/9/5 Ted Yu <[EMAIL PROTECTED]>
> > >
> > > > And your HBase version is ?
> > > >
> > > > Since you use Double.parseDouble(), looks like it would be more
> > efficient
> > > > to develop DoubleColumnInterpreter.
> > > >
> > > > On Wed, Sep 5, 2012 at 12:07 PM, Julian Wissmann
> > > > <[EMAIL PROTECTED]>wrote:
> > > >
> > > > > Hi,
> > > > > the schema looks like this:
> > > > > RowKey: id,timerange_timestamp,offset (String)
> > > > > Qualifier: Offset (long)
> > > > > Timestamp: timestamp (long)
> > > > > Value:number (BigDecimal)
> > > > >
> > > > > Or as code when I read data from csv:byte[] value > > > > > Bytes.toBytes(BigDecimal.valueOf(Double.parseDouble(cData[2])));
> > > > >
> > > > > Cheers,
> > > > >
> > > > > Julian
> > > > >
> > > > > 2012/9/5 Ted Yu <[EMAIL PROTECTED]>
> > > > >
> > > > > > You haven't told us the schema of your table yet.
> > > > > > Your table should have column whose value can be interpreted by
> > > > > > BigDecimalColumnInterpreter.
> > > > > >
> > > > > > Cheers
> > > > > >
> > > > > > On Wed, Sep 5, 2012 at 9:17 AM, Julian Wissmann <
> > > > > [EMAIL PROTECTED]
> > > > > > >wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I am currently experimenting with the
> BigDecimalColumnInterpreter
> > > > from
> > > > > > > https://issues.apache.org/jira/browse/HBASE-6669.
> > > > > > >
> > > > > > > I was thinking the best way for me to work with it would be to
> > use
> > > > the
> > > > > > Java
> > > > > > > class and just use that as is.
> > > > > > >
> > > > > > > Imported it into my project and tried to work with it as is, by
> > > just
> > > > > > > instantiating the ColumnInterpreter as
> > BigDecimalColumnInterpreter.
> > > > > Okay,
> > > > > > > threw errors and also complained about not knowing where to
> find
> > > > such a
> > > > > > > class.
> > > > > > >
> > > > > > > So I did some reading and found out, that I'd need to have an
> > > > Endpoint
> > > > > > for
> > > > > > > it. So I imported AggregateImplementation and AggregateProtocol
> > > into
> > > > my
> > > > > > > workspace, renamed them, and refactored them where necessary to

Thanks & Regards,
Anil Gupta
+
anil gupta 2012-09-05, 21:27
+
Julian Wissmann 2012-09-06, 09:28
+
anil gupta 2012-09-06, 17:19
+
anil gupta 2012-09-06, 17:24
+
Julian Wissmann 2012-09-06, 18:43
+
anil gupta 2012-09-06, 19:22
+
Julian Wissmann 2012-09-10, 16:36
+
anil gupta 2012-09-10, 18:22
+
Julian Wissmann 2012-09-12, 16:27
+
Ted Yu 2012-09-12, 16:45
+
Julian Wissmann 2012-09-12, 19:56
+
anil gupta 2012-09-14, 07:56
+
anil gupta 2012-09-14, 19:27
+
anil gupta 2012-09-14, 22:17
+
Ted Yu 2012-09-15, 14:56
+
anil gupta 2012-09-15, 15:26
+
Julian Wissmann 2012-10-03, 16:26