1、建立表tablea, 并使得tablea有一个columnfamily——cf1
create 'tablea', 'cf1'
2、在tablea表中插入rowkey1,cf1,key1=value1的信息
put 'tablea', 'rowkey1', 'cf1:key1', 'value1'
3、查询tablea
scan 'tablea'
4、插入多条数据
put 'tablea', 'rowkey2', 'cf1:key2', 'value2'
put 'tablea', 'rowkey3', 'cf1:key3', 'value3'
scan 'tablea'
5、搜索单条数据
get 'tablea','rowkey1'
get 'tablea','rowkey2'
get 'tablea','rowkey'
6、建立一个表tableb, 拥有cf1, cf2两个columnfamily
create 'tableb','cf1','cf2'
7、搜索value=?
put 'tableb','rowkey1','cf1:key1','value1'
put 'tableb','rowkey2','cf1:key1','value1'
put 'tableb','rowkey3','cf1:key1','value1'
put 'tableb','rowkey3','cf1:key1','value1'
put 'tableb','rowkey3','cf2:key1','value1'
scan 'tableb', FILTER=>"ValueFilter(=,'binary:value1')"
scan 'tableb', FILTER=>"ValueFilter(=,'binary:value2')"
8、值的覆盖
scan 'tableb'
put 'tableb','rowkey1','cf1:key1','value2'
scan 'tableb'
9、删除一个columnfamily
alter 'tableb',{NAME=>'cf1',METHOD=>'delete'}
10、删除一条数据(rowkey1 in cf1:key1)
delete 'tableb','rowkey1','cf1:key1'
11、删除一个表
disable tableb
drop 'tableb'
list
12、退出hbase shell
exit
create 'tablea', 'cf1'
2、在tablea表中插入rowkey1,cf1,key1=value1的信息
put 'tablea', 'rowkey1', 'cf1:key1', 'value1'
3、查询tablea
scan 'tablea'
4、插入多条数据
put 'tablea', 'rowkey2', 'cf1:key2', 'value2'
put 'tablea', 'rowkey3', 'cf1:key3', 'value3'
scan 'tablea'
5、搜索单条数据
get 'tablea','rowkey1'
get 'tablea','rowkey2'
get 'tablea','rowkey'
6、建立一个表tableb, 拥有cf1, cf2两个columnfamily
create 'tableb','cf1','cf2'
7、搜索value=?
put 'tableb','rowkey1','cf1:key1','value1'
put 'tableb','rowkey2','cf1:key1','value1'
put 'tableb','rowkey3','cf1:key1','value1'
put 'tableb','rowkey3','cf1:key1','value1'
put 'tableb','rowkey3','cf2:key1','value1'
scan 'tableb', FILTER=>"ValueFilter(=,'binary:value1')"
scan 'tableb', FILTER=>"ValueFilter(=,'binary:value2')"
8、值的覆盖
scan 'tableb'
put 'tableb','rowkey1','cf1:key1','value2'
scan 'tableb'
9、删除一个columnfamily
alter 'tableb',{NAME=>'cf1',METHOD=>'delete'}
10、删除一条数据(rowkey1 in cf1:key1)
delete 'tableb','rowkey1','cf1:key1'
11、删除一个表
disable tableb
drop 'tableb'
list
12、退出hbase shell
exit