使用HBase shell扫描特定列值的HTable行 [英] Scan HTable rows for specific column value using HBase shell
问题描述
我想从 hbase shell 中的列中扫描行,其中列家族(即Tweet)具有特定值(即user_id)。
现在我想查找tweet的所有行:user_id的值 虽然我可以扫描表格以查找特定的使用情况,但是,您可以使用 但我没有找到任何方法来扫描一行的值。 是否可以通过HBase Shell执行此操作? 我检查了此问题。 I want to scan rows in a HTable from hbase shell where a column family (i.e., Tweet) has a particular value (i.e., user_id). Now I want to find all rows where tweet:user_id has value Though I can scan table for a particular using, but I did not find any way to scan a row for a value. Is it possible to do this via HBase Shell? I checked this question as well. It is possible without Hive: Note: in order to find all rows that contain test1 as value as specified in the question, use binaryprefix:test1 in the filter (see this answer for more examples) 这篇关于使用HBase shell扫描特定列值的HTable行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! test1
,因为此列的值'test1'$ c
$ b $ pre $ column = tweet:user_id,timestamp = 1339581201187,value = test1
扫描'tweetsTable',{COLUMNS => 'tweet:user_id'}
scan'filemetadata',
{COLUMNS => 'colFam:colQualifier',
LIMIT => 10,
FILTER => ValueFilter(=,'binaryprefix:< someValue.eg test1 AsDefinedInQuestion>')
}
注意:为了找到包含 test1 的所有行为问题中指定的值,请在过滤器中使用 binaryprefix:test1 (请参阅这个答案的更多例子)test1
as this column has value 'test1'
column=tweet:user_id, timestamp=1339581201187, value=test1
scan 'tweetsTable',{COLUMNS => 'tweet:user_id'}
scan 'filemetadata',
{ COLUMNS => 'colFam:colQualifier',
LIMIT => 10,
FILTER => "ValueFilter( =, 'binaryprefix:<someValue.e.g. test1 AsDefinedInQuestion>' )"
}