内容简介:1.create ‘student’,‘info’
用 HBase shell进行表操作
1. 创建 student表,表结构包含info和course列族,显示表结构。
create ‘student’,‘info’ , ‘course’
desc ‘student’
2. 修改表结构, course列族返回最大版本数为3,显示表结构。
alter ‘student’,{NAME=>‘course’,VERSIONS=>3}
describe ‘student’
3. 输入数据,要求至少包括以下列
(具体数据自定, course列族要输入部分小于60分的数据)
info 列族: name 、 age 、 sex 、 dept
course 列族: english、math、physics
put ‘student’,‘001’,‘info:name’,‘liu’,3
put ‘student’,‘001’,‘info:age’,‘18’,11
put ‘student’,‘001’,‘info:sex’,‘nan’,15
put ‘student’,‘001’,‘info:dept’,‘JAVA’,10
put ‘student’,‘002’,‘info:name’,‘ma’,8
put ‘student’,‘002’,‘info:age’,‘19’,2
put ‘student’,‘002’,‘info:sex’,‘nan’,5
put ‘student’,‘002’,‘info:dept’,‘WEB’,10
put ‘student’,‘003’,‘info:name’,‘zhang’,6
put ‘student’,‘003’,‘info:age’,‘18’,4
put ‘student’,‘003’,‘info:sex’,‘nv’,10
put ‘student’,‘003’,‘info:dept’,‘JS’,9
put ‘student’,‘001’,‘course:english’,‘69’,13
put ‘student’,‘001’,‘course:math’,‘92’,16
put ‘student’,‘001’,‘course:physics’,‘46’,20
put ‘student’,‘002’,‘course:english’,‘89’,13
put ‘student’,‘002’,‘course:math’,‘64’,16
put ‘student’,‘002’,‘course:physics’,‘59’,17
put ‘student’,‘003’,‘course:english’,‘70’,13
put ‘student’,‘003’,‘course:math’,‘35’,16
put ‘student’,‘003’,‘course:physics’,‘72’,21
4. 更新数据,将 course列族中小于60的数据更新为60。
put ‘student’,‘001’,‘ course:physics’,‘60’,20
put ‘student’,‘002’,‘ course:physics’,‘60’,17
5. 使用 get进行数据查询。
get ‘student’,‘001’
6. 使用 scan进行查询。
scan ‘student’
7. 使用列族过滤器进行查询。
scan‘student’,FILTER=>“FamilyFilter(=,‘substring:info’)”
8. 创建 student表的快照stu_snap,显示快照列表。
snapshot ‘student’,‘stu_snap’
list_snapshots
9. 通过快照 stu_snap生成新表stu_info,并显示stu_info表结构。
clone_sanpshot ‘stu_snap’,‘stu_info’
desc ‘stu_info’
10. 删除快照stu_snap,删除student表。
disable ‘student’
drop ‘student’
delete_snapshot ‘stu_snap’
以上所述就是小编给大家介绍的《关于HBase Shell基本操作的表操作示例》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:- Elasticsearch索引的基本操作(8)-索引缓存、refresh、flush等操作
- MongoDB基本操作
- MySQL基本操作
- kubernetes基本操作
- Tensorflow基本操作
- gitflow基本操作
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Python科学计算(第2版)
张若愚 / 清华大学出版社 / 2016-4-29 / 118
本书介绍如何用 Python 开发科学计算的应用程序,除了介绍数值计算之外,还着重介绍了如何制作交互式二维、三维图像,如何设计精巧的程序界面,如何与 C 语言编写的高速计算程序结合,如何编写声音、图像处理算法等内容。本书采用 IPython notebook 编写,所有的程序均能在本书提供的运行环境中正常运行,书中所印刷的图表以及程序输出为均为自动运行的结果,保证了书中所有程序的正确性以及可读性。......一起来看看 《Python科学计算(第2版)》 这本书的介绍吧!