hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lars hofhansl <lhofha...@yahoo.com>
Subject Re: Query Rows matching multiple column values
Date Tue, 03 Jan 2012 17:33:14 GMT
Hi Praveen,

FilterList is the right approach and it does support AND/OR.
Checkout the constructors that take an Operator.
You can pass FilterList.Operator.MUST_PASS_ALL for AND
or FilterList.Operator.MUST_PASS_ONE for OR.

Note that FilterLists are also filters.

For example below you'd have following setup:

    SingleValueColumnFilter(column1 = 'A')
        SingleColumnValueFilter(column2 = 'B')
        SingleColumnValueFilter(column3 = 'C')

-- Lars

----- Original Message -----
From: "praveen.mar@wipro.com" <praveen.mar@wipro.com>
To: user@hbase.apache.org
Sent: Monday, January 2, 2012 10:42 PM
Subject: Query Rows matching multiple column values


I am a newbie in HBase.

I have to use HBase Client APIs to query rows matching multiple column
values.   The query is similar to this

-    Column1 = 'A'  AND (Column2='B' OR Column2='C')

I tried using FilterList for this purpose.  But FilterList do not allow
to specify an AND/OR between different filters.

Can anyone suggest the right filter mechanism.


Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are
intended for the exclusive use of the addressee(s) and may contain proprietary, confidential
or privileged information. If you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and destroy all copies
of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email
and any attachments for the presence of viruses. The company accepts no liability for any
damage caused by any virus transmitted by this email. 


View raw message