Home Forums HBase Querying HBase Table

This topic contains 3 replies, has 2 voices, and was last updated by  Jean-Philippe Player 9 months, 1 week ago.

  • Creator
    Topic
  • #44878

    I am trying to write a simple filter to be invoked from HBase Shell

    create ‘Acc’,’c1′
    put ‘Acc’,1,’c1:id’,100
    put ‘Acc’,2,’c1:id’,200
    put ‘Acc’,3,’c1:id’,300
    put ‘Acc’,4,’c1:id’,400
    put ‘Acc’,5,’c1:id’,500
    put ‘Acc’,6,’c1:id’,600
    put ‘Acc’,1,’c1:val’,100
    put ‘Acc’,2,’c1:val’,200
    put ‘Acc’,3,’c1:val’,300
    put ‘Acc’,4,’c1:val’,400
    put ‘Acc’,5,’c1:val’,500
    put ‘Acc’,6,’c1:val’,600

    Now I want to filter all rows where c1:val >= 300

    How would I do it ?

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

  • Author
    Replies
  • #45182

    Sum and Group By require an additional layer on top of HBase. There are several options available, such as project Phoenix (https://github.com/forcedotcom/phoenix) or using the Hive-Hbase integration: http://hortonworks.com/blog/hbase-via-hive-part-1.

    Collapse
    #44901

    Thanks that worked. How would you do sum group by etc ? Do you need to use mapreduce for that

    Collapse
    #44881

    Hi Paulie,

    Try this:

    scan ‘Acc’, {COLUMNS => ['c1'], FILTER => “SingleColumnValueFilter(‘c1′,’val’,>=,’binary:300′)” }

    Collapse
Viewing 3 replies - 1 through 3 (of 3 total)