Basic understanding Hbase Filters

I have a table with the following row keys (shortened for sake of the example):

s1-0                                                
s1-1                                                 
s1-2                             
s2-0                            
s2-1                          
s3-0 

I need to filter rows in these ways:

  • all rows where the first part is s1 and the second part is < 2
  • all rows where the first part is s1 and the second part is in the range 1 - 2
  • all rows where the second part is in the range 1 - 2

I started with basic filtering. If I scan the table with this filter:

Filter f  = new RowFilter(CompareOp.EQUAL, new RegexStringComparator("s1-2"));

I get only the row with:

s1-2

But if I change the filter to:

Filter f  = new RowFilter(CompareOp.LESS, new RegexStringComparator("s1-2"));

my expectation is to get:

s1-0                                                
s1-1

instead I get:

s1-0: 0
s1-1: 1
s2-0: 0
s2-1: 1
s3-0: 0

I am missing something important in understanding how filters work. Can anyone help me and provide some usefull documentation reference on filters?