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'
向学生表添加课程列族;