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 test1
as this column has value 'test1'
column=tweet:user_id, timestamp=1339581201187, value=test1
Though I can scan table for a particular using,
scan 'tweetsTable',{COLUMNS => 'tweet:user_id'}
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.
Scaning using HBase Shell The scan command is used to view the data in HTable. Using the scan command, you can get the table data. Its syntax is as follows: scan '<table name>'
It is possible without Hive:
scan 'filemetadata', { COLUMNS => 'colFam:colQualifier', LIMIT => 10, FILTER => "ValueFilter( =, 'binaryprefix:<someValue.e.g. test1 AsDefinedInQuestion>' )" }
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With