You can use the sc.objectFile <https://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.SparkContext> to read it. It will be RDD[Student] type.
Thanks Best Regards On Mon, Nov 17, 2014 at 4:03 PM, Naveen Kumar Pokala < npok...@spcapitaliq.com> wrote: > 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 >