HBase Shell 基本操作
生活随笔
收集整理的這篇文章主要介紹了
HBase Shell 基本操作
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
HBase Shell 操作
基本操作
- 進入 HBase 客戶端命令行
- 查看幫助命令
- 查看當前數(shù)據(jù)庫中有哪些表
表的操作
- 創(chuàng)建表
- 插入數(shù)據(jù)到表
- 掃描查看表數(shù)據(jù)
- 查看表結(jié)構
- 更新指定字段的數(shù)據(jù)
- 查看“指定行”或“指定列族:列”的數(shù)據(jù)
- 統(tǒng)計表數(shù)據(jù)行數(shù)
- 刪除數(shù)據(jù)
刪除某 rowkey 的全部數(shù)據(jù)
deleteall 'student','1001'刪除某 rowkey 的某一列數(shù)據(jù)
delete 'student','1002','info:sex'- 清空表數(shù)據(jù)
提示:清空表的操作順序為先 disable,然后再 truncate。
- 刪除表
首先需要先讓該表為 disable 狀態(tài)
disable 'student'然后才能 drop 這個表
drop 'student'提示:如果直接 drop 表,會報錯:ERROR: Table student is enabled. Disable it first.
- 變更表信息
將 info 列族中的數(shù)據(jù)存放 3 個版本:
alter 'student',{NAME=>'info',VERSIONS=>3}get 'student','1001',{COLUMN=>'info:name',VERSIONS=>3}總結(jié)
以上是生活随笔為你收集整理的HBase Shell 基本操作的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: HBase Error IllegalS
- 下一篇: HBase环境搭建与使用