Skip to main content
data_ali
Gold ⭐️
November 18, 2020
Solved

Retrieving a row from value on HBase Shell

I have to retrieve information from all columns of a row based on a given value.

the data is

fname - John

lname - Andrews

snumber - 008

degree - MIT

 

I have this query that returns only the degree column:
scan 'CWRK', {COLUMNS => 'STUDENT', FILTER => "ValueFilter ( =, 'binaryprefix:MIT')"}

 

this gives the result:
student:008             column=STUDENT:degree, timestamp = ......... , value=MIT

I want to run a query that returns values for all 4 attributes (fname, lname, snumber, degree) for the row-number student:008 as that is the row that has the MIT value for degree key.

Can this be done?

data_ali
data_aliAnswer
Gold ⭐️
November 19, 2020

I got it working with SingleColumnValueFilter

 

scan 'CWRK', {FILTER => "SingleColumnValueFilter = ('STUDENT','degree',=,'binary:MIT',true,true)"}

1 reply

data_ali
data_aliAuthorAnswer
Gold ⭐️
November 19, 2020

I got it working with SingleColumnValueFilter

 

scan 'CWRK', {FILTER => "SingleColumnValueFilter = ('STUDENT','degree',=,'binary:MIT',true,true)"}

Translate