标签:drop 通过 直接 显示 delete range create run zhang
hbase shell
# 进入hbase文件夹中
cd /hc/install/hbase-2.2.6/
bin/hbase shell
help
# 查看具体命令的帮助信息
help ‘create‘
list
create ‘user‘, ‘info‘, ‘data‘
#或者
create ‘user‘,{NAME => ‘info‘, VERSIONS => ‘3‘},{NAME => ‘data‘}
#向user表中插入信息,row key为rk0001,列族info中添加名为name的列,值为zhangsan
put ‘user‘, ‘rk0001‘, ‘info:name‘, ‘zhangsan‘
#向user表中插入信息,row key为rk0001,列族info中添加名为gender的列,值为female
put ‘user‘, ‘rk0001‘, ‘info:gender‘, ‘female‘
#向user表中插入信息,row key为rk0001,列族info中添加名为age的列,值为20
put ‘user‘, ‘rk0001‘, ‘info:age‘, 20
#向user表中插入信息,row key为rk0001,列族data中添加名为pic的列,值为picture
put ‘user‘, ‘rk0001‘, ‘data:pic‘, ‘picture‘
get ‘user‘, ‘rk0001‘
get ‘user‘, ‘rk0001‘, ‘info‘
get ‘user‘, ‘rk0001‘, ‘info:name‘, ‘info:age‘
get ‘user‘, ‘rk0001‘, ‘info‘, ‘data‘
#或者你也可以这样写
get ‘user‘, ‘rk0001‘, {COLUMN => [‘info‘, ‘data‘]}
#或者你也可以这样写,也行
get ‘user‘, ‘rk0001‘, {COLUMN => [‘info:name‘, ‘data:pic‘]}
get ‘user‘, ‘rk0001‘, {FILTER => "ValueFilter(=, ‘binary:zhangsan‘)"}
get ‘user‘, ‘rk0001‘, {FILTER => "QualifierFilter(=,‘substring:a‘)"}
scan ‘user‘
scan ‘user‘, {COLUMNS => ‘info‘}
#当把某些列的值删除后,具体的数据并不会马上从存储文件中删除;查询的时候,不显示被删除的数据;如果想要查询出来的话,RAW => true
scan ‘user‘, {COLUMNS => ‘info‘, RAW => true, VERSIONS => 5}
scan ‘user‘, {COLUMNS => ‘info‘, RAW => true, VERSIONS => 3}
scan ‘user‘, {COLUMNS => [‘info‘, ‘data‘]}
scan ‘user‘, {COLUMNS => ‘info:name‘}
scan ‘user‘, {COLUMNS => [‘info:name‘, ‘data:pic‘]}
scan ‘user‘, {COLUMNS => ‘info:name‘, VERSIONS => 5}
scan ‘user‘, {COLUMNS => [‘info‘, ‘data‘], FILTER => "QualifierFilter(=,‘substring:a‘)"}
scan ‘user‘, {COLUMNS => ‘info‘, STARTROW => ‘rk0001‘, ENDROW => ‘rk0003‘}
scan ‘user‘,{FILTER=>"PrefixFilter(‘rk‘)"}
scan ‘user‘, {TIMERANGE => [1392368783980, 1610288780669]}
alter ‘user‘, NAME => ‘info‘, VERSIONS => 5
delete ‘user‘, ‘rk0001‘, ‘info:name‘
delete ‘user‘, ‘rk0001‘, ‘info:name‘, 1392383705316
alter ‘user‘, NAME => ‘data‘, METHOD => ‘delete‘
#或
alter ‘user‘, ‘delete‘ => ‘info‘
truncate ‘user‘
disable ‘user‘
drop ‘user‘
(注意:如果直接drop表,会报错:Drop the named table. Table must first be disabled)
标签:drop 通过 直接 显示 delete range create run zhang
原文地址:https://www.cnblogs.com/huangwenchao0821/p/14748626.html