码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-05-03 10:28:33      阅读:156      评论: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)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!