本文介绍了通过HBase Shell行键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用
scan 'table_name', { COLUMNS => 'column_family:column_qualifier', LIMIT => 2 }
列出hbase表中的2行,但我想知道是否可以使用hbase shell实现以下目的:
to list 2 rows in a hbase table but I would like to know if it is possible to achieve following using hbase shell:
- 通过hbase shell列出所有行键吗?
- 仅列出那些行键中包含特定单词的行?
推荐答案
A1. hbase(main):015:0> count 'table_name', INTERVAL => 1
A2.将RowKey
过滤器与SubstringComparator
一起使用.
A2. Use RowKey
filter with SubstringComparator
.
用法:
hbase(main):003:0> import org.apache.hadoop.hbase.filter.CompareFilter
hbase(main):005:0> import org.apache.hadoop.hbase.filter.SubstringComparator
hbase(main):006:0> scan 'test', {FILTER => org.apache.hadoop.hbase.filter.RowFilter.new(CompareFilter::CompareOp.valueOf('EQUAL'),SubstringComparator.new("word_by_which_you_want_to_search"))}
这篇关于通过HBase Shell行键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!