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.

ERROR: Task not serializable : Converting JavaRDD Tuple3 to JavaRDD CustomObject

Highlighted

ERROR: Task not serializable : Converting JavaRDD Tuple3 to JavaRDD CustomObject

New Contributor

List<Tuple3<String, Date, Double>> interpolList = executeSubTask( hiveContext); //Some logic returns List

JavaRDD<Tuple3<String, Date, Double>> finalRdd = context.parallelize(interpolList); //Converting list to RDD

//ValorisationBean is the Pojo class which implements java.io.serialisable

JavaRDD<ValorisationBean> rowRdd = finalRdd.map(new Function<Tuple3<String, Date, Double>, ValorisationBean>() {

public ValorisationBean call(Tuple3<String, Date, Double> tupleData) throws Exception {

ValorisationBean valorisationRow = new ValorisationBean();

valorisationRow.setLibelle(tupleData._1());

valorisationRow.setDate_application(tupleData._2());

valorisationRow.setValeur(tupleData._3());

return valorisationRow;

} });

The above map function is giving ERROR: Task not serializable. Please suggest on this.