欢迎投稿

今日深度:

Hbase操作命令,hbase命令

Hbase操作命令,hbase命令


Hbase操作命令

查看表 list

查询表行数:count 'staff'

查看表是否存在:exists 'member'

判断表是否enableis_enabled 'member'

判断表是否disableis_disabled 'member'

查看表中所有数据:scan 'staff'

查看表结构:desc  'staff'

查看表中某个列族里某个属性: scan 'staf_staf_113b',{COLUMNS =>'c:staf_114'}

根据id查询: get 'staff','b9cb51e146794ffba8d838335ca300fb'

根据id查询某个列族里面的数据:

get 'staff','b9cb51e146794ffba8d838335ca300fb','c'

更新一条记录

put 'staff','b9cb51e146794ffba8d838335ca300fb','c:staf_001' ,'99'

删除数据属性 delete 'staff'','b9cb51e146794ffba8d838335ca300fb','c:staf_001'

删除整行数据:  deleteall 'staff','b9cb51e146794ffba8d838335ca300fb'

drop一个表:先 disable 'temp_table' 然后在: drop 'temp_table'

清空整张表:truncate 'staff' ----hbase是先将掉disable掉,然后drop掉后重建表来实现truncate的功能的

 

Namespace操作

HBase系统默认定义了两个缺省的namespace

hbase:系统内建表,包括namespace和meta表

default:用户建表时未指定namespace的表都创建在此

 

创建namespace create_namespace 'test_ns'

删除 namespace drop_namespace 'test_ns'

查看namespace describe_namespace 'test_ns'

列出所有namespacelist_namespace

 

namespace下创建表create 'test_ns:emp','id','name','age','address'

查看namespace下的表 list_namespace_tables 'yx'

 

 

 

www.htsjk.Com true http://www.htsjk.com/hbase/31802.html NewsArticle Hbase操作命令,hbase命令 一 Hbase 操作命令 查看表   : list 查询表行数: count 'staff' 查看表是否存在: exists 'member' 判断表是否 enable : is_enabled 'member' 判断表是否 disable : is_disabled 'm...
相关文章
    暂无相关文章
评论暂时关闭