赞
踩
hbase shell
help
list
create 'lagou', 'base_info', 'extra_info'
或者
create 'lagou', {NAME => 'base_info', VERSIONS => '3'},{NAME => 'extra_info',VERSIONS => '3'}
VERSIONS 是指此单元格内的数据可以保留最近的 3 个版本
put 'lagou', 'rk1', 'base_info:name', 'wang'
put 'lagou', 'rk1', 'base_info:age', 30
put 'lagou', 'rk1', 'extra_info:address', 'shanghai'
get 'lagou', 'rk1'
get 'lagou', 'rk1', 'base_info'
get 'lagou', 'rk1', 'base_info:name', 'base_info:age'
get 'lagou', 'rk1', 'base_info', 'extra_info'
get 'lagou', 'rk1', {COLUMN => ['base_info', 'extra_info']}
get 'lagou', 'rk1', {COLUMN => ['base_info:name', 'extra_info:address']}
get 'lagou', 'rk1', {FILTER => "ValueFilter(=, 'binary:wang')"}
get 'lagou', 'rk1', {FILTER => "(QualifierFilter(=,'substring:a'))"}
scan 'lagou'
scan 'lagou', {COLUMNS => 'base_info'}
scan 'lagou', {COLUMNS => 'base_info', RAW => true, VERSIONS => 3}
Scan时可以设置是否开启Raw模式,开启Raw模式会返回包括已添加删除标记但是未实际删除的数据 ## VERSIONS指定查询的最大版本数
scan 'lagou', {COLUMNS => ['base_info', 'extra_info'], FILTER => "(QualifierFilter(=,'substring:a'))"}
scan 'lagou', {COLUMNS => 'base_info', STARTROW => 'rk1', ENDROW => 'rk3'}
scan 'lagou',{FILTER=>"PrefixFilter('rk')"}
更新数据值 把lagou表中rowkey为rk1的base_info列族下的列name修改为liang
put 'lagou', 'rk1', 'base_info:name', 'liang'
delete 'lagou', 'rk1', 'base_info:name'
delete 'lagou', 'rk1', 'base_info:name',1600660619655
alter 'lagou', 'delete' => 'base_info'
truncate 'lagou'
先disable 再drop
disable 'lagou'
drop 'lagou'
#如果不进行disable,直接drop会报错 ERROR: Table user is enabled. Disable it first
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。