首页 > 其他 > 详细

HBase命令(二) -- 增删改查

时间:2016-05-03 10:28:29      阅读:223      评论:0      收藏:0      [点我收藏+]

HBase数据库表操作 

hbase shell> list   //列出所有表

hbase shell> create ‘mytable‘,‘col1‘,‘col2‘   //建表语句  create ‘表名‘,‘列簇名‘,‘列簇名‘,‘列簇名‘

hbase shell> scan ‘mytable‘ //遍历表内容

hbase shell> describe ‘mytable‘   //查看表的结构构造 

hbase shell> get ‘mytable‘,‘rowkey1‘   //获取表数据   get ‘表名‘,‘键名‘

hbase shell> put ‘mytable‘,‘woshikey‘,‘ct:msg‘,‘99999999999999‘   //新增或者覆盖数据 put ‘表名‘,‘键名‘,‘列名(不是列簇名)‘,‘值‘

hbase shell> disable ‘mytable‘   //暂时停用表

hbase shell> enable ‘mytable‘    //启用表

hbase shell> alter ‘mytable‘,{NAME=>‘ct‘,METHOD=>‘delete‘}   //删除表中的列  注: 要求先disable 表,,修改后enable表

hbase shell> drop ‘mytable‘    //删除表

HBase命令(二) -- 增删改查

原文:http://www.cnblogs.com/iiwen/p/5453908.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!