Hbase中常用命令用法

1.查询表数据记录条数

count   'tableName'  ,  例如: count  'opoms_order',统计opoms_order表中记录总条数

2.删除表记录

truncate 'tableName',  例如: truncate   'opoms_order' 就是删除opoms_order表中所有记录

3.插入数据

put  'tableName', 'rowKey', 'columnName','columnValue'

例如:

put  'opoms_order_router', '18547215000_8521510140000361_0','storage:shipping_sn','997581267124'

4.浏览(扫描)表

II,  scan 'tableNAME', {columns=> ['column1', 'c2'], LIMIT => 10, STARTROW => 'xyz'}

例如[按时间戳方式扫描,查找指定时间段内的数据记录]:

scan 'opoms_order_router', {COLUMNS => ['infor:order_sn', 'infor:order_belong'], LIMIT => 10, STARTROW => '18551061772_9201512010000056'}

III, 待过滤器的方式扫描表

scan 'tableNAME', {columns=> ['column1', 'c2'], LIMIT => 10, STARTROW => 'xyz',FILTER => "(PrefixFilter ('row2')"}

例如:[可以用来查找指定列是否存在表中]

scan 'opoms_order_router', {COLUMNS => ['infor:order_sn', 'infor:order_belong'], LIMIT => 10, STARTROW => '18552253959_8201511170033562',FILTER => "(PrefixFilter ('18552253959_8201511170033562'))"}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值