hbase filter练习

本文介绍了HBase中使用不同过滤器进行数据查询的具体方法,包括PrefixFilter和SingleColumnValueFilter等,并展示了实际扫描操作及返回结果。通过这些示例,读者可以了解如何精确地定位和获取所需的数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1,命令例子

scan 'scorse', {FILTER => "(PrefixFilter ('joeyon:'))"}
scan 'scorse', {FILTER => "(FirstKeyOnlyFilter ())"}
scan 'scorse',{FILTER=>"(PrefixFilter('joeyon')) AND (SingleColumnValueFilter('course','math',=,'regexstring:97',true,true))

2,测试数据

hbase(main):068:0> scan 'scorse'
ROW                                  COLUMN+CELL                                                                                             
 joeyon                              column=course:math, timestamp=1416821469350, value=97                                                   
 joeyon                              column=grad:, timestamp=1416821398138, value=5                                                          
 joeyon3                             column=course:pc, timestamp=1416877739159, value=100                                                    
 joeyon5                             column=course:math, timestamp=1416823873826, value=97                                                   
 joeyon5                             column=course:yuwen, timestamp=1416877396829, value=87                                                  
 joeyon:1                            column=course:math, timestamp=1416822508961, value=97                                                   
 joeyon:2                            column=course:math, timestamp=1416822514683, value=97                                                   
 joeyon:3                            column=course:math, timestamp=1416822518762, value=97                                                   
 joeyon:4                            column=course:math, timestamp=1416822523256, value=97                                                   
 joeyon:5                            column=course:math, timestamp=1416822528175, value=97                                                   
 xmm                                 column=course:english, timestamp=1416821567570, value=100                                               
 xmm                                 column=grad:, timestamp=1416821715259, value=1                                                          
 xyy                                 column=course:english, timestamp=1416821623967, value=100                                               
 xyy                                 column=grad:, timestamp=1416821725323, value=2                                                          
10 row(s) in 0.0420 seconds


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值