0

I have a List[org.apache.spark.sql.Row] which I got from a ListBuffer[org.apache.spark.sql.Row]()

How do I turn this into a dataframe? obviously .toDF (or RDD) does not work...

Zahiro Mor
  • 1,708
  • 1
  • 16
  • 30
  • 1
    you can convert it to RDD by sc.parallelize(your List[Row]). and then you can convert it into dataframe, but not sure what will be the dataframe structure. – Abhi Jul 12 '16 at 06:03
  • it's still an `RDD[Row]` and won't be converted by `toDF`..... – Zahiro Mor Jul 12 '16 at 10:04
  • import sqlContext.implicits._ and then use toDF(your column names), on the RDD[T] – Abhi Jul 12 '16 at 10:45

0 Answers0