Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hbase custom filter with get operation

Solved Go to solution

Hbase custom filter with get operation

New Contributor

I have created a custom filter to filter data of columns (here column name will be numbers like 2,3,4,5,) whose column name is grater than 4, but the filter is not working as expected. please help me how can i resolve this.

below is the code

@Override public ReturnCode filterKeyValue(Cell cell) { String data=new String(value); int val =Integer.parseInt(data); String celldata=new String(CellUtil.cloneQualifier(cell)); int col=Integer.parseInt(celldata); System.out.println("from Custom filter:"+celldata); if (col>val) { filterRow = false; } return ReturnCode.INCLUDE; }

Am i overriding the correct method to get data of only a particular column?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Hbase custom filter with get operation

New Contributor

Thanks, I am able to do the custom filer operation. I have removed the filterRow() method overriding from my custom filter class after that its working as expected

Thanks

Ashok

2 REPLIES 2

Re: Hbase custom filter with get operation

New Contributor

By using the custom filter i can filter out a particular row, but can i use Hbase custom filter to get particular column in that row??

Actually I have millions of column in a row and i want to select a particular column in a row. is there any way i can achieve this using Hbase custom filters?

Re: Hbase custom filter with get operation

New Contributor

Thanks, I am able to do the custom filer operation. I have removed the filterRow() method overriding from my custom filter class after that its working as expected

Thanks

Ashok

Don't have an account?
Coming from Hortonworks? Activate your account here