熟悉HBase基本操作

1.以下关系型数据库中的表和数据,要求将其转换为适合于HBase存储的表并插入数据:

学生表(Student)(不包括最后一列)

put 'Student','188','S_No','2015001'

put 'Student','190','S_No','2015003'

put 'Student','200','S_No','2015003'

put 'Student','188','S_Name','Zhangsan'

put 'Student','190','S_Name','Mary'

put 'Student','200','S_Name','Lisi'

put 'Student','188','S_Sex','male'

put 'Student','190','S_Sex','female'

put 'Student','200','S_Sex','male'

put 'Student','188','S_Age','23'

put 'Student','190','S_Age,'22'

put 'Student','200','S_Age','24'

 

 

 

 

 

 

2.用Hadoop提供的HBase Shell命令完成相同任务:

(1)列出HBase所有的表的相关信息;list

(2)在终端打印出学生表的所有记录数据;

(3)向学生表添加课程列族;

alter 'Student','NAME'=>'course'

(4)向课程列族添加数学列并登记成绩为85;

put 'Student','s003','course:Math','85'

(5)删除课程列;

disable 'Student'

dorp 'Student','course'

(6)统计表的行数;count 's1'

count 'Student'

 

(7)清空指定的表的所有记录数据;truncate 's1'

truncate 'Student'


 

 

向学生表添加课程列族;

转载于:https://www.cnblogs.com/YY0302/p/9009334.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值