alter 'myns:student', 'f1', 'f2'
6、删除列族f1和f2
alter 'myns:student',{NAME=>'f1',METHOD=>'delete'},{NAME=>'f2',METHOD=>'delete'} 或者一个一个删除 alter 'myns:student','delete'=>'f1' alter 'myns:student','delete'=>'f2'
7、怎么删除hbase中的一张表
先disable禁用表,再drop删除
第三大题:table的crud操作(shell练习)
1、将一下数据添加到student表(请放到相应的列族中)
sid name age gender math chinese math provinces city street 201901010001 zhaoyun 23 m 90 89 100 hlj harbin pudonglu 201901010002 zhangfei 24 f 80 78 90 hebei shijiazhuang tianyulu 201901010003 guanyu jilin
put 'myns:student','201901010001','base_info:name','zhaoyun' put 'myns:student','201901010001','base_info:age',23 put 'myns:student','201901010001','base_info:gender','m' put 'myns:student','201901010001','score:math',90 put 'myns:student','201901010001','score:chinese',89 put 'myns:student','201901010001','score:english',100 put 'myns:student','201901010001','address:provinces','hlj' put 'myns:student','201901010001','address:city','habin' put 'myns:student','201901010001','address:street','pudonglu'put 'myns:student','201901010002','base_info:name','zhangfei' put 'myns:student','201901010002','base_info:age',24 put 'myns:student','201901010002','base_info:gender','f' put 'myns:student','201901010002','score:math',80 put 'myns:student','201901010002','score:chinese',78 put 'myns:student','201901010002','score:english',90 put 'myns:student','201901010002','address:provinces','hebei' put 'myns:student','201901010002','address:city','shijiazhuang' put 'myns:student','201901010002','address:street','tianyulu'put 'myns:student','201901010003','base_info:name','guanyu' put 'myns:student','201901010003','address:provinces','jilin'
put 'myns:student', '201901010002', 'base_info:name', 'zhangfei1' put 'myns:student', '201901010002', 'base_info:name', 'zhangfei2'
6、查询201901010002的name的历史版本
get 'myns:student', '201901010002', {COLUMN =>'base_info:name', VERSIONS => 3}