Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase >> mail # user >> Get all rows that DON'T have certain qualifiers


Copy link to this message
-
Get all rows that DON'T have certain qualifiers
Hi all,

I'm trying to scan my HBase table to get only rows that are missing some
qualifiers.

I read that for getting rows with specific qualifiers I should use
something like:

List list = new ArrayList<Filter>(2);
Filter filter1 = new SingleColumnValueFilter(Bytes.toBytes("fam1"),
 Bytes.toBytes("VALUE1"), CompareOp.DOES_NOT_EQUAL,
Bytes.toBytes("DOESNOTEXIST"));
filter1.setFilterIfMissing(true);
list.addFilter(filter1);
Filter filter2 = new SingleColumnValueFilter(Bytes.toBytes("fam2"),
 Bytes.toBytes("VALUE2"), CompareOp.DOES_NOT_EQUAL,
Bytes.toBytes("DOESNOTEXIST"));
filter2.setFilterIfMissing(true);
list.addFilter(filter2);
FilterList filterList = new FilterList(list);
Scan scan = new Scan();
scan.setFilter(filterList);

(I found this here:
http://mapredit.blogspot.co.il/2012/05/using-filters-in-hbase-to-match-two.html
)
And it works just fine.

So as I thought that if I use SkipFilter(FilterList) I'll skip the rows
returned by the filter list >> causing a sort of NOT and getting all rows
that don't have any of theses qualifiers.

This doesn't seem to work... Anyone has a good suggestion how to get rows
that are missing specific qualifiers ? Any idea why SkipFilter fails ?

Thanks,

Amit