0

I have tried with single row-key ,its working fine but i am unable to fetch multiple row-key scan.

scan 'LPV',{FILTER =>"(PrefixFilter('174','194')"}

getting error,find Filter to support scan multiple row key ranges but didnt find is it possible or not ? I want to fetch multiple records based on multiple row-keys. Any help,Thanks.

Aashu
  • 1,247
  • 1
  • 26
  • 41

2 Answers2

3

You just need to OR two PrefixFilters as in

scan 'LPV',{FILTER =>"(PrefixFilter('174') OR PrefixFilter('194')"}
Arnon Rotem-Gal-Oz
  • 25,469
  • 3
  • 45
  • 68
0

I am not sure there is a solution in Hbase shell for multiple prefix filter. But you can write a script to do multiple prefixfilter one by one. for example put your key prefixes to a file a1.txt line by line;

a1.txt
-------
pref1
pref2
pref3

then run a script like (i am not good at shell scripting. you can do better)

cat a1.txt | while read LINE; do echo "scan 'LPV',{FILTER=>\"PrefixFilter('$LINE')\"} " | hbase shell;done
ozhang
  • 171
  • 9