Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
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'