標籤:hbase shell操作大全 hbase shell操作
1.進入Hbase命令列
>hbase shell
退出命令列
>quit
2.建立表
>create 'users','user_id','address','info'
3.查看所有表
>list
4.查看錶結構
>describe 'users'
5.刪除表:
>disable 'users'>drop 'users'
6.新增資料
>put 'users','xiaowang','info:age','26'>put 'users','xiaoming','address:city','beijing'>put 'users','xiaowang','address:city','shagnhai'
7.修改資料
>put 'users','xiaoming','info:age','27'
8.擷取row資訊
>get 'users','xiaoming'
9.擷取column資訊
>get 'users','xiaoming','info:age'
10.擷取column versions資訊(建表時不指定預設儲存3個版本的資料)
>get 'users','xiaoming',{COLUMN='info:age',VERSIONS=>3}
11.擷取column某個版本的資料(TIMESTAMP為插入式指定目前時間戳)
>get 'users','xiaoming',{COLUMN='info:age',TIMESTAMP=>15134937056}
12.全表掃描
>scan 'users'
13.刪除column
>delete 'users','xiaoming','info:age'
14.刪除row
>deleteall 'users','xiaowang'
15.統計行數
>count 'users'
16.清空表
>truncate 'users'
我的個人網站:http://www.caicongyang.com ;
我的CSDN部落格地址: http://blog.csdn.net/caicongyang ;
Hbase shell操作(完整版記錄)