Support Questions

Find answers, ask questions, and share your expertise

Hbase shell command to keep filter on multiple columns

avatar
New Contributor

I have a hbase table table1. Now i need to write a shell command to pick the row value by keeping filter on two columns like (c1='ABC' and c2<>'xyz'). Please help here.

Here is the command i used:

echo "scan 'table1', {COLUMNS => ['Details'],FILTER => \"(SingleColumnValueFilter('Details','ABC',=,'binary:col1',true,true)) AND (SingleColumnValueFilter('Details','XYZ',!=,'binary:col2',true,true))\"}"|hbase shell

1 REPLY 1

avatar
New Contributor

Got the solution: echo "scan 'table1' ,{ FILTER => \"(SingleColumnValueFilter('Details','col2',!=, 'binary:XYZ')) AND (QualifierFilter (=, 'binary:col1'))\"}" |hbase shell |grep ABC |awk '{print $1}'