1
votes

I need to scan a hbase table based on a single column. I want to get all the rows which has the column value from one of the values. i.e I want to get the rows where cf2:q2 is either A or B. I could use singlecolumnvaluefilter but i had to create a filter for each value. So if i have 10 values i have to use 10 filters. I want to know what is the best way to do this? Is there any better way than creating filters for each value?

ROW                  COLUMN+CELL
     row1                 column=cf1:q1, timestamp=1321296699190, value=TestName1
     row1                 column=cf2:q2, timestamp=1321296715892, value=A
     row2                 column=cf1:q1, timestamp=1321296699190, value=TestName1
     row2                 column=cf2:q2, timestamp=1321296715892, value=B
     row3                 column=cf1:q1, timestamp=1321296699190, value=TestName1
     row3                 column=cf2:q2, timestamp=1321296715892, value=C
1

1 Answers

1
votes

I hope the option you mentioned is similar to this link. Most of the suggestions involved the same approach using a FilterList. But as the values increase, it becomes tedious to just add multiple filters for each value. Looks like writing your custom filter, seems the other option. You can get the life cycle events of custom filter in Hbase - Definitive Guide Book; Chapter 4: Client API: Advanced Features. Hope it helps. Happy coding