hbase常用shell命令

#查看表
describe 'edw_applications:rec_cb_item_user'

#创建表
create 'edw_applications:rec_cb_item_user', {NAME => 'fangyuan', VERSIONS => 2, COMPRESSION => 'SNAPPY'}, {NAME => 'loupan', VERSIONS => 2, COMPRESSION => 'SNAPPY'}

#删除表
disable 'edw_applications:rec_cb_item_user'
drop 'edw_applications:rec_cb_item_user'

#范围扫描
scan 'edw_applications:user_profile_customer', STARTROW=> '00502be7c4df-8509-d144-b2c8-03108f00', ENDROW=> '00502be7c4df-8509-d144-b2c8-03108f00'

#rowkey值扫描
scan 'edw_applications:user_profile_cid_mapping', FILTER=>"ValueFilter(=,'binary:01b4e8ef4619-daaa-8d54-21d3-a2ba2dbf ')"

#列值扫描
scan 'event_new', STARTROW=> '0000893000', FILTER=>"ColumnPrefixFilter('biz_type') AND ( ValueFilter(=,'binary:1') OR ValueFilter(=,'binary:3') )"
scan 'edw_applications:user_profile_customer',{LIMIT=>5}

#插入
put 'edw_applications:user_profile_customer','000002f13285-7b48-29b4-5e9e-684068a3','basic_info:name','18600024218'

#查询(cf、qualifier)
get 'edw_applications:user_profile_customer','000002f13285-7b48-29b4-5e9e-684068a3',COLUMN=>'basic_info:name',VERSIONS=>5
get 'edw_applications:user_profile_customer','000002f13285-7b48-29b4-5e9e-684068a3',COLUMN=>'basic_info',VERSIONS=>5

#表记录条数
count 'edw_applications:rec_cb_item_user', {INTERVAL => 100, CACHE => 500}

#表edw_applications:rec_cb_item_user_1重命名为edw_applications:rec_cb_item_user_2
disable 'edw_applications:rec_cb_item_user_1'
snapshot 'edw_applications:rec_cb_item_user_1', 'rec_cb_item_user_snapshot'
clone_snapshot 'rec_cb_item_user_snapshot', 'edw_applications:rec_cb_item_user_2'
delete_snapshot 'rec_cb_item_user_snapshot'
drop 'edw_applications:rec_cb_item_user_1'



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值