You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by samir das mohapatra <sa...@gmail.com> on 2013/11/27 13:29:43 UTC

Region Server based filter using SingleColumnValueFilter is not working in CDH4.2.1 but working on CDH4.1.2

Dear Hadoop/Hbase Developer,

  I was trying to scan the hbase table  by  applying  *SingleColumnValueFilter
 ,* It workes fine in CDH4.1.2  but when same code  I am running in Other
Dev cluster which is not working under CDH4.2.1 , Is there any issue with
version difference or it is a code level issue ?

  I am sharing the code which i wrote in Driver level scanning for hbase
mapreduce.

CODE
*****************

 List<Filter> filters = new ArrayList<Filter>();

   SingleColumnValueFilter colValFilter = new
SingleColumnValueFilter(Bytes.toBytes("cf1"), Bytes.toBytes("code"),
CompareFilter.CompareOp.EQUAL, new SubstringComparator("SAMIR_AL_START "));


    colValFilter.setFilterIfMissing(false);
    filters.add(colValFilter);


    FilterList fl = new FilterList( FilterList.Operator.MUST_PASS_ALL,
filters);


    Scan scan = new Scan();
    scan.setFilter(fl);
    scan.addColumn(Bytes.toBytes("cf1"), Bytes.toBytes("sequence_id"));
    scan.addColumn(Bytes.toBytes("cf1"), Bytes.toBytes("session_id"));
    scan.addColumn(Bytes.toBytes("cf1"), Bytes.toBytes("timestamp"));
    scan.addColumn(Bytes.toBytes("cf1"), Bytes.toBytes("userguid"));
    scan.addColumn(Bytes.toBytes("cf1"), Bytes.toBytes("code"));

****************************************************************************************

*Note: same code when I am running, it is not giving  only
 "SAMIR_AL_START " value as output , rather then it is producing the other
family's some Other value. *

*For example I want to filter the record  from hbase which containes only
"SAMIR_AL_START"  as value under families 'cf1' and qualifier 'code' (It is
giving as i wanted under CDH4.1.2 but when I am running same code in Other
cluder(CDH4.2.1) *
*which is not giving  the right output )*



*If Incase anyone already  aware with this type of filter in hbase using
java could you please help me on the same problem.*





*Thanks,*
*samir. *