spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akhil Das <ak...@sigmoidanalytics.com>
Subject Re: HDFS read text file
Date Mon, 17 Nov 2014 11:02:15 GMT
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 <
npokala@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
>

Mime
View raw message