When I am trying to get the result from Hbase and running mapToPair function of RRD its giving the error java.io.NotSerializableException: org.apache.hadoop.hbase.client.Result
Here is the code // private static JavaPairRDD<Integer, Result> getCompanyDataRDD(JavaSparkContext sc) throws IOException { // return sc.newAPIHadoopRDD(companyDAO.getCompnayDataConfiguration(), TableInputFormat.class, ImmutableBytesWritable.class, // Result.class).mapToPair(new PairFunction<Tuple2<ImmutableBytesWritable, Result>, Integer, Result>() { // // public Tuple2<Integer, Result> call(Tuple2<ImmutableBytesWritable, Result> t) throws Exception { // System.out.println("In getCompanyDataRDD"+t._2); // // String cknid = Bytes.toString(t._1.get()); // System.out.println("processing cknids is:"+cknid); // Integer cknidInt = Integer.parseInt(cknid); // Tuple2<Integer, Result> returnTuple = new Tuple2<Integer, Result>(cknidInt, t._2); // return returnTuple; // } // }); // }