You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Mariam Salloum <ma...@gmail.com> on 2013/07/10 22:10:48 UTC

Querying with multiple filters

HI All,

I'm new to HBase. I was trying to write a query with multiple filters. I am able to write the query with a single column filter. As follows:

scan 'webpage', {COLUMNS => 'f:bid', FILTER=> SingleColumnValueFilter.new(Bytes.toBytes('f'),Bytes.toBytes('bid'),CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new('houston_tx'))}

How am I able to specify multiple filters? I'm using the Hbase Shell

Thank you for your help

Mariam 

Re: Querying with multiple filters

Posted by Ted Yu <yu...@gmail.com>.
You would see this in the help for 'scan' command:

  hbase> scan 't1', {FILTER => "(PrefixFilter ('row2') AND (QualifierFilter
(>=, 'binary:xyz'))) AND (TimestampsFilter ( 123, 456))"}

Cheers

On Wed, Jul 10, 2013 at 1:10 PM, Mariam Salloum <ma...@gmail.com>wrote:

> HI All,
>
> I'm new to HBase. I was trying to write a query with multiple filters. I
> am able to write the query with a single column filter. As follows:
>
> scan 'webpage', {COLUMNS => 'f:bid', FILTER=>
> SingleColumnValueFilter.new(Bytes.toBytes('f'),Bytes.toBytes('bid'),CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new('houston_tx'))}
>
> How am I able to specify multiple filters? I'm using the Hbase Shell
>
> Thank you for your help
>
> Mariam