hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Graham <billgra...@gmail.com>
Subject FilterList not working as expected
Date Fri, 18 Feb 2011 18:57:15 GMT
Hi,

I'm unable to get ColumnPrefixFilter working when I use it in a
FilterList and I'm wondering if this is a bug or a mis-usage on my
part. If I set ColumnPrefixFilter directly on the Scan object all
works fine. The following code shows an example of scanning a table
with a column descriptor 'info:last_name' where we only want rows
where that column exists. Approach #1 below doesn't filter, but #2
does. I'm using the latest 0.90.1 snapshot (0.90.1-20110215.213202-4).

HTable table = new HTable("SampleTable");
Scan s = new Scan();

byte[] colPrefix = Bytes.toBytes("last_");
Filter prefixFilter = new ColumnPrefixFilter(colPrefix);

// Approach 1: the following 3 lines do not filter
FilterList filterList = new FilterList();
filterList.addFilter(prefixFilter);
s.setFilter(filterList);

// Approach #2: if I instead use this, filtering is fine
//s.setFilter(prefixFilter);

ResultScanner scanner = table.getScanner(s);


thanks,
Bill

Mime
View raw message