
Scan scan = new Scan(); scan.setStartRow(Bytes.toBytes(startRow)); scan.setStopRow(Bytes.toBytes(stopRow)); 有没有把两种效果结合起来的方法,模糊匹配 rowkey 是否存在,比如 rowkey 的格式是 12345$yyyyMMddHHmmss,67890$yyyyMMddHHmmss
能通过传入 12345 就快速判断 hbase 中是否有 rowkey 以 12345 开头的数据
总之就是 快速 足够快 特别快
谢谢各位大佬了!!!
1 nthin0 OP 没有大佬帮忙看一下吗~~ |
2 yanshenxian 2020 年 9 月 7 日 |
3 thinkmore 2020 年 9 月 8 日 @nthin0 可以使用 prefixFilter 试一试,比如 ``` scan 'yourTable',{LIMIT=>10,FILTER=>"PrefixFilter('123456')"} ``` 或者 RowFilter ``` scan 'your_table',{FILTER=>"RowFilter(=,'substring:123456')"} ``` |
4 thinkmore 2020 年 9 月 8 日 @nthin0 在我的 blog https://generalthink.github.io/2018/12/17/hbase-scan-command/ 中可以看到 scan 的更多命令 |