hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: FilterList passing RowFilter and QualifierFilter
Date Sat, 14 Jan 2017 09:16:08 GMT
If you have multiple rowids, you can chain them with MUST_PASS_ONE. Chain the multiple qualifiers
with MUST_PASS_ONE. 
Finally chain these two groups with MUST_PASS_ALL. 

Cheers

> On Jan 13, 2017, at 10:47 PM, Prahalad kothwal <kothwaldev@gmail.com> wrote:
> 
> It works fine when I apply rowfilter and qualifier filter and pass one
> rowid and one qualifier .
> 
> I am  passing more than one rowid's  and one or more qualifiers and it
> doesn't seem to work .
> 
> with MUST_PASS_ALL. it doesn't return anything, but with MUST_PASS_ONE it
> returns incorrect results.
> 
> 
> 
>> On Fri, Jan 13, 2017 at 11:34 PM, Ted Yu <yuzhihong@gmail.com> wrote:
>> 
>> According to your description, MUST_PASS_ONE should not be used.
>> 
>> Please use MUST_PASS_ALL.
>> 
>> Cheers
>> 
>> On Fri, Jan 13, 2017 at 10:02 AM, Prahalad kothwal <kothwaldev@gmail.com>
>> wrote:
>> 
>>> Yes through FilterList
>>> 
>>> FilterList filterList = new FilterList(FilterList.
>> Operator.MUST_PASS_ONE);
>>> for(String rowid : rowIds){
>>> 
>>>  rowFilter = new RowFilter(CompareFilter.CompareOp.EQUAL, new
>>> BinaryComparator(Bytes.toBytes(rowid)));
>>> filterList.addFilter(rowFilter);
>>> filter = new QualifierFilter(CompareFilter.CompareOp.EQUAL, new
>>> BinaryComparator(Bytes.toBytes(qualifier)) );
>>> filterList.addFilter(filter);
>>> scan.setFilter(filterList);
>>> 
>>> ResultScanner results = table.getScanner(scan);
>>> for(Result result : results){
>>> List<Cell> cells = result.listCells();
>>> 
>>> For what I can see its not limiting to the rowids I have passed and
>>> returning  columns that was not passed in the Qualifierfilter.
>>> 
>>> Thanks,
>>> Prahalad
>>> 
>>> 
>>> 
>>>> On Fri, Jan 13, 2017 at 8:33 PM, Ted Yu <yuzhihong@gmail.com> wrote:
>>>> 
>>>> Can you illustrate how the two filters were combined (I assume through
>>>> FilterList) ?
>>>> 
>>>> I think the order of applying the filters should be RowFilter followed
>> by
>>>> QualifierFilter.
>>>> 
>>>> Cheers
>>>> 
>>>> On Fri, Jan 13, 2017 at 6:55 AM, Prahalad kothwal <
>> kothwaldev@gmail.com>
>>>> wrote:
>>>> 
>>>>> Hi ,
>>>>> 
>>>>> Can I pass both RowFilter and QualifierFilter and expect HBase to
>>> filter
>>>> on
>>>>> both rowkey and Qualifier ?
>>>>> 
>>>>> I tried applying both filters but I am not getting accurate results.
>>>>> 
>>>>> 
>>>>> Any help is appreciated .
>>>>> 
>>>>> Thanks,
>>>>> Prahalad
>> 

Mime
View raw message