1. 如下關係型數據庫中的表和數據,要求將其轉換爲適合於HBase存儲的表並插入數據:數據庫
學生表(Student)(不包括最後一列)oop
學號(S_No)spa |
姓名(S_Name)code |
性別(S_Sex)blog |
年齡(S_Age)數學 |
課程(course)it |
2015001table |
Zhangsanclass |
male終端 |
23 |
|
2015003 |
Mary |
female |
22 |
|
2015003 |
Lisi |
male |
24 |
數學(Math)85 |
create 'Student', ' S_No ','S_Name', 'S_Sex','S_Age' put 'Student','s001','S_No','2015001' put 'Student','s001','S_Name','Zhangsan' put 'Student','s001','S_Sex','male' put 'Student','s001','S_Age','23' put 'Student','s002','S_No','2015003' put 'Student','s002','S_Name','Mary' put 'Student','s002','S_Sex','female' put 'Student','s002','S_Age','22' put 'Student','s003','S_No','2015003' put 'Student','s003','S_Name','Lisi' put 'Student','s003','S_Sex','male' put 'Student','s003','S_Age','24'
2. 用Hadoop提供的HBase Shell命令完成相同任務:
scan 'Student' alter 'Student','NAME'=>'course' put 'Student','3','course:Math','85' dorp 'Student','course' count 's1' truncate 's1'