问题
I'm trying to convert an RDD that has a fixed size lists of strings (a result of parsing CSV file) into and RDD of Rows. This is so I can turn it into a dataframe, because I need it into a dataframe to write to parquet. Anyway the only part I need help with is the converting of Rdd from list of strings to Row.
The RDD variable name is RDD
回答1:
I used:
import org.apache.spark.sql._
val RowRDD = RDD.map(r => Row.fromSeq(r))
来源:https://stackoverflow.com/questions/35441126/rdd-of-list-string-convert-to-row