hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Gray" <jl...@streamy.com>
Subject Re: Filtering by SingleColumnValueFilter
Date Thu, 03 Sep 2009 17:37:44 GMT
That filter just underwent a rewrite this week, there is certainly
possibility for a bug... However it does seem you are seeing expected
behavior.

What exactly are you trying to do?  You want to return the entire row if
it makes the value (get all columns in the family if one column matches),
if it matches BOTH, if it matches EITHER... I don't follow exactly what
you want to have as the end result returned to the client.

Could you define more specifically what you want your result to be?

JG

On Thu, September 3, 2009 10:08 am, Adrian Olariu wrote:
> Hi,
> I'm trying to use some filters and the results are not like expected.
> Maybe there it's a bug. I'm using HBase 0.20.0 RC3
> I'm trying to filter rows using SingleColumnValueFilter like this:
> Scan s = new Scan();
>
>
> Filter filter1 = new SingleColumnValueFilter(Bytes.toBytes("F1"),
> Bytes.toBytes("c1"), CompareOp.EQUAL, Bytes.toBytes("1"));
> Filter filter2 = new SingleColumnValueFilter(Bytes.toBytes("F1"),
> Bytes.toBytes("c2"), CompareOp.EQUAL, Bytes.toBytes("1"));
> List<Filter> rowFilters = new ArrayList<Filter>();
> rowFilters.add(filter1);rowFilters.add(filter2); Filter filter = new
> FilterList(FilterList.Operator.MUST_PASS_ONE,
> rowFilters);
>
> s.addColumn(Bytes.toBytes("F1"), Bytes.toBytes("c1"));
> s.addColumn(Bytes.toBytes("F1"), Bytes.toBytes("c2"));
> s.setFilter(filter);
>
> long startTime = System.currentTimeMillis(); ResultScanner scanner =
> table.getScanner(s);
>
> This filter returns all rows the contains F1:c1 whit val "1" or contains
> F1:c2 whit val "1" or contains both.
> If I replace "addColumn" methods whit s.addFamily("F1"); the scanner
> returns all rows from the table whit no filtering eaven if the F1:c1/c2
> columns doesn't exist
>
> How can I get only the rows that matches all the conditions?
>
>
> Thank you,
> Olariu Adrian.
>
>


Mime
View raw message