Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Multiple prefix row filter to scanner hbase java

I want to create one scanner that will give me result with 2 prefix filters
For example I want all the rows that their key starts with the string "x" or start with the string "y".
Currently I know to do it only with one prefix with the following way:

scan.setRowPrefixFilter(prefixFiltet)
like image 484
MosheCh Avatar asked Feb 27 '26 17:02

MosheCh


1 Answers

In this case you can't use the setRowPrefixFilter API, you have to use the more general setFilter API, something like:

scan.setFilter(
  new FilterList(
    FilterList.Operator.MUST_PASS_ONE, 
    new PrefixFilter('xx'), 
    new PrefixFilter('yy')
  )
);
like image 187
Daniel Gómez Ferro Avatar answered Mar 01 '26 07:03

Daniel Gómez Ferro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!