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(ResultScannerImpl.java:83)

        at com.ericsson.test.main.main(main.java:62)

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

        at com.mapr.fs.Inode.checkError(Inode.java:1760)

        at com.mapr.fs.Inode.checkError(Inode.java:1719)

        at com.mapr.fs.Inode.scanNext(Inode.java:1493)

        at com.mapr.fs.MapRHTable.scanNext(MapRHTable.java:755)

        at com.mapr.fs.MapRResultScanner.nextRows(MapRResultScanner.java:58)

        at com.mapr.fs.hbase.ResultScannerImpl.next(ResultScannerImpl.java:42)

        at com.mapr.fs.hbase.ResultScannerImpl.next(ResultScannerImpl.java:28)

        at com.mapr.fs.hbase.ResultScannerImpl$1.hasNext(ResultScannerImpl.java:80)

        ... 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"));
filterList.addFilter(customFilter);
scan.setFilter(filterList);
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.

Attachments

Outcomes