Hi,

I'm having some trouble doing aggregation on a particular column in HBase.

This is the snippet of code I tried:

 Configuration config = HBaseConfiguration.create();
 AggregationClient aggregationClient = new AggregationClient(config);

 Scan scan = new Scan();
 scan.addColumn(Bytes.toBytes("drs"), Bytes.toBytes("count"));

 ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();

 Long sum = aggregationClient.sum(Bytes.toBytes("DEMO_CALCULATIONS"),
ci , scan);
 System.out.println(sum);

sum returns a value of null. The aggregationClient API works fine if I do a
rowcount.

I was trying to follow the directions in
http://michaelmorello.blogspot.in/2012/01/row-count-hbase-aggregation-example.html

Could there be a problem with me using a LongColumnInterpreter when the
'count' field was an int? What am I missing in here?


Regards,

James

Reply via email to