The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

HBase Forum

Querying HBase Table

  • #44878
    Zin Zin
    Participant

    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 ?

  • Author
    Replies
  • #44881

    Hi Paulie,

    Try this:

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

    #44901
    Zin Zin
    Participant

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

    #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.

    #79306
    MIGUEL RD
    Participant

    <pre id=”tw-target-text” class=”tw-data-text vk_txt tw-ta tw-text-small” dir=”ltr” style=”unicode-bidi: -webkit-isolate; font-family: inherit; border: none; padding: 0px 0.14em 0px 0px; position: relative; margin-top: 0px; margin-bottom: 0px; resize: none; overflow: hidden; width: 237.5px; white-space: pre-wrap; word-wrap: break-word; color: #212121; height: 384px;” data-placeholder=”Traducción” data-fulltext=””><span lang=”en”>Hi I have the same doubt that the former friend .
    I want to make this query:

     scan ‘ t_community ‘ , { COLUMNS = > [ ‘community ‘] , FILTER = > ” SingleColumnValueFilter ( ‘community ‘, ‘ NUM_TOTAL ‘ , > =, ‘binary : 10’ ) “}

    but the results are not due , when I compare values ​​by more than a figure that is 10 and older.

    Can anybody help me?</span>

    #79307
    MIGUEL RD
    Participant

    <p style=”box-sizing: border-box; margin-top: 0px; font-family: ‘Helvetica Neue’, Helvetica, Arial, ‘Open Sans’, ‘Lucida Grande’, sans-serif; font-size: 14.4px; line-height: 21.6px; background-color: #fbfbfb;”>Hi I have the same doubt that the former friend .<br style=”box-sizing: border-box;” />I want to make this query:</p>
    <p style=”box-sizing: border-box; font-family: ‘Helvetica Neue’, Helvetica, Arial, ‘Open Sans’, ‘Lucida Grande’, sans-serif; font-size: 14.4px; line-height: 21.6px; background-color: #fbfbfb;”> scan ‘ t_community ‘ , { COLUMNS = > [ ‘community ‘] , FILTER = > ” SingleColumnValueFilter ( ‘community ‘, ‘ NUM_TOTAL ‘ , > =, ‘binary : 10’ ) “}</p>
    <p style=”box-sizing: border-box; font-family: ‘Helvetica Neue’, Helvetica, Arial, ‘Open Sans’, ‘Lucida Grande’, sans-serif; font-size: 14.4px; line-height: 21.6px; background-color: #fbfbfb;”>but the results are not due , when I compare values ​​by more than a figure that is 10 and older.</p>
    <p style=”box-sizing: border-box; font-family: ‘Helvetica Neue’, Helvetica, Arial, ‘Open Sans’, ‘Lucida Grande’, sans-serif; font-size: 14.4px; line-height: 21.6px; background-color: #fbfbfb;”>Can anybody help me?</p>

The forum ‘HBase’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.