0

I am new to hbase and trying to write below query in hbase shell

Select f1,f2, sum(f3) from t1 where f1<3 group by f1,f2

OR

Select f1,f2 from t1 where f1<3

I put the data into hbase

hbase(main):022:0> scan 't1'
ROW                                COLUMN+CELL                                                                                        
 1                                 column=f1:, timestamp=1473153098191, value=2                                                       
 1                                 column=f2:, timestamp=1473153106483, value=Ajay                                                    
 1                                 column=f3:, timestamp=1473153113917, value=90                                                      
 2                                 column=f1:, timestamp=1473153159384, value=1                                                       
 2                                 column=f2:, timestamp=1473153159422, value=Amit                                                  
 2                                 column=f3:, timestamp=1473153160329, value=92                                                      
 3                                 column=f1:, timestamp=1473153204785, value=2                                                       
 3                                 column=f2:, timestamp=1473153204847, value=Ajay                                                    
 3                                 column=f3:, timestamp=1473153205430, value=92                                                      
3 row(s) in 0.0240 seconds

I tried to use MultipleColumnPrefixFilter but not able to get the desired result.

Please help.

Ajay
  • 783
  • 3
  • 16
  • 37
  • don't think filter can do that, how about run a map-reduce job? – sel-fish Sep 07 '16 at 05:30
  • ok.. understood.. HBase is not built for this type of functionality... I suppose simple filter we can do in hbase.. Please see the edits. `Select f1,f2 from t1 where f1<3` – Ajay Sep 07 '16 at 11:24
  • even without aggregation, this query can't be supported by built-in filter, but a custom filter can do this job. – sel-fish Sep 08 '16 at 04:16

0 Answers0