Hello Naveen, I think you should first override "toString" method of your sample.spark.test.Student class.
-- Cordialement, Hlib Mykhailenko Doctorant à INRIA Sophia-Antipolis Méditerranée 2004 Route des Lucioles BP93 06902 SOPHIA ANTIPOLIS cedex ----- Original Message ----- > From: "Naveen Kumar Pokala" <npok...@spcapitaliq.com> > To: user@spark.apache.org > Sent: Monday, November 17, 2014 11:33:44 AM > Subject: HDFS read text file > Hi, > JavaRDD<Instrument> studentsData = sc .parallelize( list );--list is Student > Info List<Student> > studentsData .saveAsTextFile( "hdfs://master/data/spark/instruments.txt" ); > above statements saved the students information in the HDFS as a text file. > Each object is a line in text file as below. > How to read that file, I mean each line as Object of student. > -Naveen