Created 02-08-2017 12:25 PM
I have a table dept_tbl in HBase with 1 Column Family and 3 columns in it
cf1:dept_city, cf1:dept_name, cf1:dept_no
-------
I want to filter a column say dept_no and get the corresponding dept_name for it
Like: if dept_no=10, return dept_name=ACCOUNTING
-------
I applied filter as below:
scan 'dept_tbl',{FILTER => "MultipleColumnPrefixFilter('dept_name','dept_no') AND SingleColumnValueFilter('cf1','dept_no',=, 'binary:10')"}
-------
This returns me 2 columns: 'dept_name' and 'dept_no'
I need only 1 column 'dept_name' to be returned
-------
If I use MultipleColumnPrefixFilter('dept_name').. it gives me all rows as if it didnt check for filter of dept_no=10
I tried many combinations, I couldnt get it to return single column single row.
-------
Script to create the table:
create 'dept_tbl','cf1' put 'dept_tbl','R1','cf1:dept_no','10' put 'dept_tbl','R1','cf1:dept_name','ACCOUNTING' put 'dept_tbl','R1','cf1:dept_city','NEW YORK' put 'dept_tbl','R2','cf1:dept_no','20' put 'dept_tbl','R2','cf1:dept_name','RESEARCH' put 'dept_tbl','R2','cf1:dept_city','DALLAS' put 'dept_tbl','R3','cf1:dept_no','30' put 'dept_tbl','R3','cf1:dept_name','SALES' put 'dept_tbl','R3','cf1:dept_city','CHICAGO' put 'dept_tbl','R4','cf1:dept_no','40' put 'dept_tbl','R4','cf1:dept_name','OPERATIONS' put 'dept_tbl','R4','cf1:dept_city','BOSTON'
Created 02-08-2017 01:42 PM
Created 02-08-2017 01:42 PM
Created 02-08-2017 01:49 PM
whoaaa.. yes.. it works.. good to know the order matters.. thank you!