learning-spark icon indicating copy to clipboard operation
learning-spark copied to clipboard

Want to create a Row Object In Java

Open SushantVarshney opened this issue 9 years ago • 1 comments

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

SushantVarshney avatar Sep 14 '16 07:09 SushantVarshney

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

  1. sparkContext.parallize(collection)

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

tahervali avatar Nov 21 '19 11:11 tahervali