AnsweredAssumed Answered

Exception on using custom comparators

Question asked by bhaskar.suhar on Jun 21, 2017
Latest reply on Jul 13, 2017 by MichaelSegel

We are working on creating custom comparators and using them with Scan/Get in MapR db. To achieve the same we have created the jar file that contains the custom comparator classes as well as classes generated by ProtoC Compiler.

We have tested the same with HBase v1.2.6 by adding the custom comparator jar in the lib directory of HBase and it was working as expected.

We are trying same by adding jar in Map-R db lib directory but Scan query throwing the below exception :


java.lang.RuntimeException: com.mapr.fs.ErrnoException: scanNext() on '/Tables/customer_1' failed with error: Invalid argument (22).

        at com.mapr.fs.hbase.ResultScannerImpl$1.hasNext(


Caused by: com.mapr.fs.ErrnoException: scanNext() on '/Tables/customer_1' failed with error: Invalid argument (22).

        at com.mapr.fs.Inode.checkError(

        at com.mapr.fs.Inode.checkError(

        at com.mapr.fs.Inode.scanNext(

        at com.mapr.fs.MapRHTable.scanNext(

        at com.mapr.fs.MapRResultScanner.nextRows(



        at com.mapr.fs.hbase.ResultScannerImpl$1.hasNext(

        ... 1 more

Below is the sample code that we have used to fetch data :

Scan scan = new Scan();
FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL);
SingleColumnValueFilter customFilter = new SingleColumnValueFilter(Bytes.toBytes("d"), Bytes.toBytes("COL_ID"), CompareOp.EQUAL, new CustomComparator("CE0D62252B374280A3BD84D33694E6F3"));
ResultScanner scanner = table.getScanner(scan);

Above Scan query is working fine with existing BinaryComparator comparator

Please suggest on how we can go forward with this.