Created 06-21-2016 12:03 PM
Hey,
I have a hbase table with 4 columns. I want to search for a string in column1 and get the value of column2 from every row, where I get a match. I works with these two codelines
scan 'table', { COLUMNS => 'column1', FILTER => "ValueFilter(=, 'substring:value')"}
Then foreach row: get 'table', $row, {COLUMNS => 'column2'}
How can I get the result (e.g. 'value1, value2, value3') by executing only one command?
best regards
J.H.
Created 06-21-2016 01:22 PM
You can use SingleColumnValueFilter on 'column1'
Meanwhile, specify all the columns you want to retrieve using COLUMNS.
Created 06-21-2016 01:22 PM
You can use SingleColumnValueFilter on 'column1'
Meanwhile, specify all the columns you want to retrieve using COLUMNS.
Created 06-21-2016 01:42 PM
Thank you for the help. Maybe you can give me an example how to use it, because I get only errors and the examples which I found are not for the shell.
Created 06-21-2016 02:05 PM
Please take a look at hbase-shell//src/test/ruby/hbase/table_test.rb for sample syntax where x is column family:
@test_table._scan_internal(FILTER => "SingleColumnValueFilter('x', 'a', >=, 'binary:\x82', true, true)", COLUMNS => 'x:a, x:b'