Hbase Filter filter

Hbase Filter filter

1. You can use show_filters to view all filters

Insert image description here
Insert image description here
Insert image description here

2. Details of each row key

Insert image description here
Insert image description here
Insert image description here
Insert image description here

3. Specific command line code implementation
#scan 使用过滤器 行健前缀过滤器,只有这一个有属性
scan 'test2:emp', {ROWPREFIXFILTER => '2'}

#scan 使用空值行健过滤器,只返回行健
scan 'test2:emp',{FILTER=>'KeyOnlyFilter()'}
scan 'test2:emp',{FILTER =>org.apache.hadoop.hbase.filter.KeyOnlyFilter.new()}

#scan 使用行健过滤器,binary: 帮助数据类型转化
scan 'test2:emp',{FILTER=>"RowFilter(>,'binary:1')"}
scan 'test2:emp',{FILTER =>"RowFilter(!=,'binary:10001')"}

#scan 使用列名过滤器
scan 'test2:emp',{FILTER =>"QualifierFilter(>=,'binary:baseinfo:name')"}
#scan 列名前缀过滤器
scan 'test2:emp',{FILTER =>"ColumnPrefixFilter('name')"}


#scan 使用子串过滤器
scan 'test2:emp',{FILTER =>"ValueFilter(=,'binary:zhao')"}
#scan 使用多种过滤器进行条件结合
scan 'test2:emp',{FILTER =>"(ValueFilter(=,'binary:hello')) OR (RowFilter (>,'binary:10'))"}

#scan 使用page过滤器,限制每页展示数量
scan 'test2:emp',{STARTROW=>'1',ENDROW=>'5',FILTER =>'PageFilter(3)'}

#scan 使用行健过滤器,进行正则表达式的匹配
scan 'test2:emp', {FILTER => org.apache.hadoop.hbase.filter.RowFilter.new(org.apache.hadoop.hbase.filter.CompareFilter::CompareOp.valueOf('EQUAL'),org.apache.hadoop.hbase.filter.RegexStringComparator.new('.*1.*'))}

Guess you like

Origin blog.csdn.net/agatha_aggie/article/details/127261761