1.创建一个​​Rumenz​​表

// 创建了两个列族user和depart
> ./bin/hbase shell
> create 'Rumenz','user','depart'

2.插入数据

> put 'Rumenz','user|id1','user:name','张三'
> put 'Rumenz','user|id1','depart:name','开发部'
> put 'Rumenz','user|id2','user:name','王五'
> put 'Rumenz','user|id2','depart:name','市场部'
> put 'Rumenz','user|tsc','user:name','入门'
> put 'Rumenz','user1|id1','user:name','小站'

3.找出值为​​张三​​的记录

> scan 'Rumenz',FILTER=>"ValueFilter(=,'binary:张三')"

4.找出值中包含​​部​​字的记录

> scan 'Rumenz',FILTER=>"ValueFilter(=,'substring:部')"

5.找出列名以​​dep​​开头的记录

> scan 'Rumenz',FILTER=>"ColumnPrefixFilter('dep')"

6.找出列名以​​ts​​开头并且值为​​入门​​的值

> scan 'Rumenz',FILTER=>"ColumnPrefixFilter('ts') AND ValueFilter(=,'binary:入门')"

7.找出rowkey以​​user1​​开头

> scan 'Rumenz',FILTER=>"PrefixFilter('user1')"

8.一个rowkey可能有会多个版本,通过FirstKeyOnlyFilter可以获取最新版本的数据.获取最新数据中值中包含​​部​​的数据

> scan 'Rumenz',FILTER=>"FirstKeyOnlyFilter() and ValueFilter(=,'substring:部')"

9.一个rowkey可能有会多个版本,通过FirstKeyOnlyFilter可以获取最新版本的数据.获取最新数据中值中包含​​部​​的数据并且只返回key不需要value

> scan 'Rumenz',FILTER=>"FirstKeyOnlyFilter() and ValueFilter(=,'substring:部') AND KeyOnlyFilter()"

10.从​​user|id2​​行开始,查询rowkey以​​user​​开头的数据

> sacn 'Rumenz',{STARTROW=>'user|id2',FILTER=>"PrefixFilter('user')"}

11.查找rowkey中包含​​id​​的数据

> scan 'Rumenz', {FILTER => RowFilter.new(CompareFilter::CompareOp.valueOf('EQUAL'), SubstringComparator.new('id'))}

12.查找​​user:name​​列值为​​王五​​的数据并只显示​​user:name​​列

//显示多个列使用COLUMNS => ['user:name','xxxx']
>scan 'Rumenz', {COLUMNS => 'user:name', FILTER => SingleColumnValueFilter.new(Bytes.toBytes('u