At work, sometimes simply want to look at HBase table values for some key indicators, and this time we can not now write Java code to view the following a few tips you might frequently used.
1. There are many columns in a row, just 2 to obtain the specified data 3
hbase> get 't1', 'r1', ['f:c1', 'f:c2', 'f:c3']
2. want to see multiple versions of a data field
hbase> get 't1', 'r1', {COLUMN => 'f:c1', VERSIONS => 4}
3. want to see is of Chinese or hexadecimal numbers
hbase> put 't1','r1','f:c1','中国'
hbase> get 't1','r1','f:c1:toString'
COLUMN CELL
f:c1 timestamp=1585635275771, value=中国
1 row(s) in 0.0180 seconds
For Int type, Long type value, support toInt | toLong syntax.
4. quickly obtain all the columns in a column group
使用列族过滤器:
1. 精确匹配列族
hbase> get 't1,'r1',FILTER=>"FamilyFilter(=,'binary:f')"
2. 模糊匹配列族
hbase> get 't1,'r1',FILTER=>"FamilyFilter(=,'substring:f')"
5. The data acquisition column name prefix
hbase> get 't1','r1',FILTER=>"ColumnPrefixFilter('c')"
Unusual syntax is no longer discussed.
Please indicate the source!