You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Vikash Agarwal <vi...@gmail.com> on 2018/02/16 08:36:27 UTC

MultipleColumnPrefixFilter issues with SingleColumnValueFilter

Hi Team,


Currently I am trying to use MultipleColumnPrefixFilter along with
SingleColumnValueFilter and the results  that I am getting seems to be
problematic.

I have an hbase table "test_messages" with column family  "main" and Column
Qualifiers as : "pa", "cs" ,"eps","cst","ver","nm","parl".
Assume all the row Keys of the table  has all the above columns.


Now When I am creating Filters as below:


FilterList temp=new FilterList(FilterList.Operator.MUST_PASS_ALL);

SingleColumnValueFilter filter1= new
SingleColumnValueFilter("main","pa",CompareFilter.CompareOp.LESS_OR_EQUAL,
Bytes.toBytes("SomeValue"));
filter1 .setFilterIfMissing(true);

SingleColumnValueFilter filter2= new
SingleColumnValueFilter("main","cs",CompareFilter.CompareOp.EQUAL,
Bytes.toBytes("SomeValue"));
filter2.setFilterIfMissing(true);


SingleColumnValueFilter filter3= new
SingleColumnValueFilter("main",eps",CompareFilter.CompareOp.EQUAL,
Bytes.toBytes("SomeValue"));
filter3.setFilterIfMissing(true);

Case 1:

MultipleColumnPrefixFilter cpfxf=new MultipleColumnPrefixFilter(new
byte[][]{ Bytes.toBytes("pa"),Bytes.toBytes("cs"),Bytes.toBytes("eps")});
temp.addFilter(cpfxf);

The above filters results in proper extratcion of data from Hbase.


Now if I create a MultipleColumnPrefixFilter  as below:

Case 2:
MultipleColumnPrefixFilter cpfxf=new MultipleColumnPrefixFilter(new
byte[][]{ Bytes.toBytes("pa"),Bytes.toBytes("eps")});        //Note "cs" is
removed
temp.addFilter(cpfxf);

I don't get any data

However if I create a filter as

Case 3:
MultipleColumnPrefixFilter cpfxf=new MultipleColumnPrefixFilter(new
byte[][]{ Bytes.toBytes("pa"),Bytes.toBytes("cs")});              // Note
"eps" is removed and "cs"  is added back.
temp.addFilter(cpfxf);

I get lot of data.


EIther both Case 2 and Case 3 should give data or none of them.
Can someone Explain me the reason for this to happen ? Or is there a bug in
MultipleColumnPrefixFilter .





-- 
Vikash Agarwal

Fwd: MultipleColumnPrefixFilter issues with SingleColumnValueFilter

Posted by Vikash Agarwal <vi...@gmail.com>.
Hi Team,


Currently I am trying to use MultipleColumnPrefixFilter along with
SingleColumnValueFilter and the results  that I am getting seems to be
problematic.

I have an hbase table "test_messages" with column family  "main" and Column
Qualifiers as : "pa", "cs" ,"eps","cst","ver","nm","parl".
Assume all the row Keys of the table  has all the above columns.


Now When I am creating Filters as below:


FilterList temp=new FilterList(FilterList.Operator.MUST_PASS_ALL);

SingleColumnValueFilter filter1= new SingleColumnValueFilter("main"
,"pa",CompareFilter.CompareOp.LESS_OR_EQUAL, Bytes.toBytes("SomeValue"));
filter1 .setFilterIfMissing(true);

SingleColumnValueFilter filter2= new SingleColumnValueFilter("main"
,"cs",CompareFilter.CompareOp.EQUAL, Bytes.toBytes("SomeValue"));
filter2.setFilterIfMissing(true);


SingleColumnValueFilter filter3= new SingleColumnValueFilter("main"
,eps",CompareFilter.CompareOp.EQUAL, Bytes.toBytes("SomeValue"));
filter3.setFilterIfMissing(true);

Case 1:

MultipleColumnPrefixFilter cpfxf=new MultipleColumnPrefixFilter(new
byte[][]{ Bytes.toBytes("pa"),Bytes.toBytes("cs"),Bytes.toBytes("eps")});
temp.addFilter(cpfxf);

The above filters results in proper extratcion of data from Hbase.


Now if I create a MultipleColumnPrefixFilter  as below:

Case 2:
MultipleColumnPrefixFilter cpfxf=new MultipleColumnPrefixFilter(new
byte[][]{ Bytes.toBytes("pa"),Bytes.toBytes("eps")});        //Note "cs" is
removed
temp.addFilter(cpfxf);

I don't get any data

However if I create a filter as

Case 3:
MultipleColumnPrefixFilter cpfxf=new MultipleColumnPrefixFilter(new
byte[][]{ Bytes.toBytes("pa"),Bytes.toBytes("cs")});              // Note
"eps" is removed and "cs"  is added back.
temp.addFilter(cpfxf);

I get lot of data.


EIther both Case 2 and Case 3 should give data or none of them.
Can someone Explain me the reason for this to happen ? Or is there a bug in
MultipleColumnPrefixFilter .


Vikash Agarwal

Re: MultipleColumnPrefixFilter issues with SingleColumnValueFilter

Posted by Ted Yu <yu...@gmail.com>.
I don't see filter[1-3] being used in the cases.
Was any of them in the FilterList ?

Which release of hbase are you using ?

Cheers

On Fri, Feb 16, 2018 at 12:36 AM, Vikash Agarwal <vi...@gmail.com>
wrote:

> Hi Team,
>
>
> Currently I am trying to use MultipleColumnPrefixFilter along with
> SingleColumnValueFilter and the results  that I am getting seems to be
> problematic.
>
> I have an hbase table "test_messages" with column family  "main" and Column
> Qualifiers as : "pa", "cs" ,"eps","cst","ver","nm","parl".
> Assume all the row Keys of the table  has all the above columns.
>
>
> Now When I am creating Filters as below:
>
>
> FilterList temp=new FilterList(FilterList.Operator.MUST_PASS_ALL);
>
> SingleColumnValueFilter filter1= new
> SingleColumnValueFilter("main","pa",CompareFilter.CompareOp.LESS_OR_EQUAL,
> Bytes.toBytes("SomeValue"));
> filter1 .setFilterIfMissing(true);
>
> SingleColumnValueFilter filter2= new
> SingleColumnValueFilter("main","cs",CompareFilter.CompareOp.EQUAL,
> Bytes.toBytes("SomeValue"));
> filter2.setFilterIfMissing(true);
>
>
> SingleColumnValueFilter filter3= new
> SingleColumnValueFilter("main",eps",CompareFilter.CompareOp.EQUAL,
> Bytes.toBytes("SomeValue"));
> filter3.setFilterIfMissing(true);
>
> Case 1:
>
> MultipleColumnPrefixFilter cpfxf=new MultipleColumnPrefixFilter(new
> byte[][]{ Bytes.toBytes("pa"),Bytes.toBytes("cs"),Bytes.toBytes("eps")});
> temp.addFilter(cpfxf);
>
> The above filters results in proper extratcion of data from Hbase.
>
>
> Now if I create a MultipleColumnPrefixFilter  as below:
>
> Case 2:
> MultipleColumnPrefixFilter cpfxf=new MultipleColumnPrefixFilter(new
> byte[][]{ Bytes.toBytes("pa"),Bytes.toBytes("eps")});        //Note "cs"
> is
> removed
> temp.addFilter(cpfxf);
>
> I don't get any data
>
> However if I create a filter as
>
> Case 3:
> MultipleColumnPrefixFilter cpfxf=new MultipleColumnPrefixFilter(new
> byte[][]{ Bytes.toBytes("pa"),Bytes.toBytes("cs")});              // Note
> "eps" is removed and "cs"  is added back.
> temp.addFilter(cpfxf);
>
> I get lot of data.
>
>
> EIther both Case 2 and Case 3 should give data or none of them.
> Can someone Explain me the reason for this to happen ? Or is there a bug in
> MultipleColumnPrefixFilter .
>
>
>
>
>
> --
> Vikash Agarwal
>