6.5 实训任务 HBase shell 常见命令的使用

网友投稿 325 2022-11-15

6.5 实训任务 HBase shell 常见命令的使用

0、进入HBase shell

cd /home/bigdata/Opt/hbase-2.4.12/bin

./hbase shell

1、 创建成绩表,列簇为 id,name,course

create 'scores','id','name','course'

````````````emo emo emo emo emo emo emo`````````````````,报错了·······

ERROR: KeeperErrorCode = ConnectionLoss for /hbase/master

2、查看当前HBase里有哪些表

list

3、查看当前表scores的表结构

describe 'scores'

4、按照给定成绩表,插入数据

put 'scores','20220510','name:name','LanLan'put 'scores','20220510','course:chinese','85'put 'scores','20220510','course:math','90'put 'scores','20220510','course:english','92'put 'scores','20220511','name:name','XiQi'put 'scores','20220511','course:chinese','86'put 'scores','20220511','course:math','95'put 'scores','20220511','course:english','98'put 'scores','20220512','name:name','YangYan'put 'scores','20220512','course:chinese','95'put 'scores','20220512','course:math','80'put 'scores','20220512','course:english','82'

5、扫描当前表scores里的数据

scan 'scores'

6、查看序号为20220510的学生的姓名,查看序号为 20220510学生的数学成绩

get 'scores','20225010','name'get 'scores','20220510','course:math'

7、修改scores表中数据,序号为20220511学生的姓名,20220512学生的英语成绩

disable 'scores'alter 'scores','20220511','name','NiCai'alter 'scores','20220512','course:english'=>'99'enable 'scores'scan 'scores'

8、删除当前表scores中序号为20220510的学生的数学成绩

disable 'scores'alter 'scores','20220510','course:math'=>'delete'enable 'scores'scan 'scores'

9、统计当前表scores里的数据记录的条数

count 'scores'

10、刷新当前表scores

flush 'scores'

11、查看当前用户

whoami

12、删除当前表scores中序号为20220510的学生信息

deleteall 'scores','20220510'scan 'scores'

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:基于TLC320AC01与DSP的接口设计
下一篇:USB接口不识别设备的问题及处理办法
相关文章

 发表评论

暂时没有评论,来抢沙发吧~