databricks / learning-spark

Example code from Learning Spark book
MIT License
3.89k stars 2.42k forks source link

Want to create a Row Object In Java #25

Open SushantVarshney opened 8 years ago

SushantVarshney commented 8 years ago

In my analysis code I want to create a JavaRDD of type Row from another data. Can u provide me solution for this

tahervali commented 4 years ago

Step 1. Convert a Collection of Strings or a text file to JavaRDD .

  1. sparkContext.parallize(collection)

Step 2. Map the stringRDD to a rowRDD 2)rdd.map(RowFactory.create(string[0],string[1])