How to convert Iterable[String, String, String] to DataFrame?

Viewed 1386

I have a dataset of (String, String, String) which is about 6GB. After parsing the dataset I did groupby using (element => element._2) and got RDD[(String, Iterable[String, String, String])]. Then foreach element in groupby I am doing toList in-order to convert it to DataFrame.

val dataFrame = groupbyElement._2.toList.toDF()

But It is taking a huge amount of time to save data as parquet file format. Is there any efficient way I can use? N.B. I have five node cluster. Each node has 28 GB RAM and 4 cores. I am using standalone mode and giving 16 GB RAM to each executor.

1 Answers
Related